var PlaySDKInterface = (function (e) {
	var t = {};
	function n(r) {
		if (t[r]) return t[r].exports;
		var o = (t[r] = { i: r, l: !1, exports: {} });
		return e[r].call(o.exports, o, o.exports, n), (o.l = !0), o.exports;
	}
	return (
		(n.m = e),
		(n.c = t),
		(n.d = function (e, t, r) {
			n.o(e, t) || Object.defineProperty(e, t, { enumerable: !0, get: r });
		}),
		(n.r = function (e) {
			'undefined' !== typeof Symbol && Symbol.toStringTag && Object.defineProperty(e, Symbol.toStringTag, { value: 'Module' }),
				Object.defineProperty(e, '__esModule', { value: !0 });
		}),
		(n.t = function (e, t) {
			if ((1 & t && (e = n(e)), 8 & t)) return e;
			if (4 & t && 'object' === typeof e && e && e.__esModule) return e;
			var r = Object.create(null);
			if ((n.r(r), Object.defineProperty(r, 'default', { enumerable: !0, value: e }), 2 & t && 'string' != typeof e))
				for (var o in e)
					n.d(
						r,
						o,
						function (t) {
							return e[t];
						}.bind(null, o)
					);
			return r;
		}),
		(n.n = function (e) {
			var t =
				e && e.__esModule
					? function () {
							return e.default;
						}
					: function () {
							return e;
						};
			return n.d(t, 'a', t), t;
		}),
		(n.o = function (e, t) {
			return Object.prototype.hasOwnProperty.call(e, t);
		}),
		(n.p = ''),
		n((n.s = 1))
	);
})([
	,
	function (e, t, n) {
		'use strict';
		n.r(t);
		var r = { Opera: 'Opera', Chrome: 'Chrome', Firefox: 'Firefox', Edge: 'Edge', Edg: 'Edg', IE: 'IE', Safari: 'Safari' };
		function o() {
			var e = navigator.userAgent;
			return e.includes('Edge')
				? r.Edge
				: e.includes('Edg')
					? r.Edg
					: e.includes('Firefox')
						? r.Firefox
						: e.includes('Chrome')
							? r.Chrome
							: e.includes('Safari')
								? r.Safari
								: e.includes('compatible') && e.includes('MSIE') && e.includes('Opera')
									? r.IE
									: e.includes('Opera')
										? r.Opera
										: '';
		}
		function a(e) {
			return navigator.userAgent.split(e)[1].split('.')[0].slice(1);
		}
		var i = { log: function () {}, error: function () {}, count: function () {}, info: function () {} };
		function s() {
			var e = navigator.userAgent.toLowerCase(),
				t = navigator.appName,
				n = null;
			return (
				'Microsoft Internet Explorer' === t || e.indexOf('trident') > -1 || e.indexOf('edge/') > -1
					? ((n = 'ie'),
						'Microsoft Internet Explorer' === t
							? ((e = /msie ([0-9]{1,}[\.0-9]{0,})/.exec(e)), (n += parseInt(e[1])))
							: e.indexOf('trident') > -1
								? (n += 11)
								: e.indexOf('edge/') > -1 && (n = 'edge'))
					: e.indexOf('safari') > -1
						? (n = e.indexOf('chrome') > -1 ? 'chrome' : 'safari')
						: e.indexOf('firefox') > -1 && (n = 'firefox'),
				n
			);
		}
		(function () {
			function e() {}
			(e.createFromElementId = function (t) {
				for (var n = document.getElementById(t), r = '', o = n.firstChild; o; ) 3 === o.nodeType && (r += o.textContent), (o = o.nextSibling);
				var a = new e();
				return (a.type = n.type), (a.source = r), a;
			}),
				(e.createFromSource = function (t, n) {
					var r = new e();
					return (r.type = t), (r.source = n), r;
				});
		})(),
			(function () {
				function e(e) {
					(this.gl = e), (this.program = this.gl.createProgram());
				}
				e.prototype = {
					attach: function (e) {
						this.gl.attachShader(this.program, e.shader);
					},
					link: function () {
						this.gl.linkProgram(this.program);
					},
					use: function () {
						this.gl.useProgram(this.program);
					},
					getAttributeLocation: function (e) {
						return this.gl.getAttribLocation(this.program, e);
					},
					setMatrixUniform: function (e, t) {
						var n = this.gl.getUniformLocation(this.program, e);
						this.gl.uniformMatrix4fv(n, !1, t);
					},
				};
			})(),
			(function () {
				var e = null;
				function t(e, t, n) {
					(this.gl = e),
						(this.size = t),
						(this.texture = e.createTexture()),
						e.bindTexture(e.TEXTURE_2D, this.texture),
						(this.format = n || e.LUMINANCE),
						e.texImage2D(e.TEXTURE_2D, 0, this.format, t.w, t.h, 0, this.format, e.UNSIGNED_BYTE, null),
						e.texParameteri(e.TEXTURE_2D, e.TEXTURE_MAG_FILTER, e.NEAREST),
						e.texParameteri(e.TEXTURE_2D, e.TEXTURE_MIN_FILTER, e.NEAREST),
						e.texParameteri(e.TEXTURE_2D, e.TEXTURE_WRAP_S, e.CLAMP_TO_EDGE),
						e.texParameteri(e.TEXTURE_2D, e.TEXTURE_WRAP_T, e.CLAMP_TO_EDGE);
				}
				t.prototype = {
					fill: function (e, t) {
						var n = this.gl;
						n.bindTexture(n.TEXTURE_2D, this.texture),
							t
								? n.texSubImage2D(n.TEXTURE_2D, 0, 0, 0, this.size.w, this.size.h, this.format, n.UNSIGNED_BYTE, e)
								: n.texImage2D(n.TEXTURE_2D, 0, this.format, this.size.w, this.size.h, 0, this.format, n.UNSIGNED_BYTE, e);
					},
					bind: function (t, n, r) {
						var o = this.gl;
						e || (e = [o.TEXTURE0, o.TEXTURE1, o.TEXTURE2]),
							o.activeTexture(e[t]),
							o.bindTexture(o.TEXTURE_2D, this.texture),
							o.uniform1i(o.getUniformLocation(n.program, r), t);
					},
				};
			})();
		function l(e) {
			return (l =
				'function' === typeof Symbol && 'symbol' === typeof Symbol.iterator
					? function (e) {
							return typeof e;
						}
					: function (e) {
							return e && 'function' === typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? 'symbol' : typeof e;
						})(e);
		}
		if ('undefined' == typeof u) var u = {};
		u.MD5 = function (e) {
			function t(e) {
				var t = (e >>> 0).toString(16);
				return '00000000'.substr(0, 8 - t.length) + t;
			}
			function n(e, t, n) {
				return (e & t) | (~e & n);
			}
			function r(e, t, n) {
				return (n & e) | (~n & t);
			}
			function o(e, t, n) {
				return e ^ t ^ n;
			}
			function a(e, t, n) {
				return t ^ (e | ~n);
			}
			function i(e, t) {
				return (e[t + 3] << 24) | (e[t + 2] << 16) | (e[t + 1] << 8) | e[t];
			}
			function s(e) {
				for (var t = [], n = 0; n < e.length; n++)
					if (e.charCodeAt(n) <= 127) t.push(e.charCodeAt(n));
					else for (var r = encodeURIComponent(e.charAt(n)).substr(1).split('%'), o = 0; o < r.length; o++) t.push(parseInt(r[o], 16));
				return t;
			}
			function u(e) {
				for (var t = new Array(e.length), n = 0; n < e.length; n++) t[n] = e[n];
				return t;
			}
			var c = null,
				f = null;
			function p(e, t) {
				return 4294967295 & (e + t);
			}
			return (
				'string' == typeof e
					? (c = s(e))
					: e.constructor == Array
						? 0 === e.length
							? (c = e)
							: 'string' == typeof e[0]
								? (c = (function (e) {
										for (var t = [], n = 0; n < e.length; n++) t = t.concat(s(e[n]));
										return t;
									})(e))
								: 'number' == typeof e[0]
									? (c = e)
									: (f = l(e[0]))
						: 'undefined' != typeof ArrayBuffer
							? e instanceof ArrayBuffer
								? (c = u(new Uint8Array(e)))
								: e instanceof Uint8Array || e instanceof Int8Array
									? (c = u(e))
									: e instanceof Uint32Array ||
										  e instanceof Int32Array ||
										  e instanceof Uint16Array ||
										  e instanceof Int16Array ||
										  e instanceof Float32Array ||
										  e instanceof Float64Array
										? (c = u(new Uint8Array(e.buffer)))
										: (f = l(e))
							: (f = l(e)),
				f && alert('MD5 type mismatch, cannot process ' + f),
				(function () {
					function e(e, t, n, r) {
						var o,
							a,
							i = v;
						(v = _), (_ = h), (h = p(h, (((o = p(S, p(e, p(t, n)))) << (a = r)) & 4294967295) | (o >>> (32 - a)))), (S = i);
					}
					var s = c.length;
					c.push(128);
					var l = c.length % 64;
					if (l > 56) {
						for (var u = 0; u < 64 - l; u++) c.push(0);
						l = c.length % 64;
					}
					for (u = 0; u < 56 - l; u++) c.push(0);
					c = c.concat(
						(function (e) {
							for (var t = [], n = 0; n < 8; n++) t.push(255 & e), (e >>>= 8);
							return t;
						})(8 * s)
					);
					var f = 1732584193,
						d = 4023233417,
						m = 2562383102,
						g = 271733878,
						S = 0,
						h = 0,
						_ = 0,
						v = 0;
					for (u = 0; u < c.length / 64; u++) {
						S = f;
						var y = 64 * u;
						e(n((h = d), (_ = m), (v = g)), 3614090360, i(c, y), 7),
							e(n(h, _, v), 3905402710, i(c, y + 4), 12),
							e(n(h, _, v), 606105819, i(c, y + 8), 17),
							e(n(h, _, v), 3250441966, i(c, y + 12), 22),
							e(n(h, _, v), 4118548399, i(c, y + 16), 7),
							e(n(h, _, v), 1200080426, i(c, y + 20), 12),
							e(n(h, _, v), 2821735955, i(c, y + 24), 17),
							e(n(h, _, v), 4249261313, i(c, y + 28), 22),
							e(n(h, _, v), 1770035416, i(c, y + 32), 7),
							e(n(h, _, v), 2336552879, i(c, y + 36), 12),
							e(n(h, _, v), 4294925233, i(c, y + 40), 17),
							e(n(h, _, v), 2304563134, i(c, y + 44), 22),
							e(n(h, _, v), 1804603682, i(c, y + 48), 7),
							e(n(h, _, v), 4254626195, i(c, y + 52), 12),
							e(n(h, _, v), 2792965006, i(c, y + 56), 17),
							e(n(h, _, v), 1236535329, i(c, y + 60), 22),
							e(r(h, _, v), 4129170786, i(c, y + 4), 5),
							e(r(h, _, v), 3225465664, i(c, y + 24), 9),
							e(r(h, _, v), 643717713, i(c, y + 44), 14),
							e(r(h, _, v), 3921069994, i(c, y), 20),
							e(r(h, _, v), 3593408605, i(c, y + 20), 5),
							e(r(h, _, v), 38016083, i(c, y + 40), 9),
							e(r(h, _, v), 3634488961, i(c, y + 60), 14),
							e(r(h, _, v), 3889429448, i(c, y + 16), 20),
							e(r(h, _, v), 568446438, i(c, y + 36), 5),
							e(r(h, _, v), 3275163606, i(c, y + 56), 9),
							e(r(h, _, v), 4107603335, i(c, y + 12), 14),
							e(r(h, _, v), 1163531501, i(c, y + 32), 20),
							e(r(h, _, v), 2850285829, i(c, y + 52), 5),
							e(r(h, _, v), 4243563512, i(c, y + 8), 9),
							e(r(h, _, v), 1735328473, i(c, y + 28), 14),
							e(r(h, _, v), 2368359562, i(c, y + 48), 20),
							e(o(h, _, v), 4294588738, i(c, y + 20), 4),
							e(o(h, _, v), 2272392833, i(c, y + 32), 11),
							e(o(h, _, v), 1839030562, i(c, y + 44), 16),
							e(o(h, _, v), 4259657740, i(c, y + 56), 23),
							e(o(h, _, v), 2763975236, i(c, y + 4), 4),
							e(o(h, _, v), 1272893353, i(c, y + 16), 11),
							e(o(h, _, v), 4139469664, i(c, y + 28), 16),
							e(o(h, _, v), 3200236656, i(c, y + 40), 23),
							e(o(h, _, v), 681279174, i(c, y + 52), 4),
							e(o(h, _, v), 3936430074, i(c, y), 11),
							e(o(h, _, v), 3572445317, i(c, y + 12), 16),
							e(o(h, _, v), 76029189, i(c, y + 24), 23),
							e(o(h, _, v), 3654602809, i(c, y + 36), 4),
							e(o(h, _, v), 3873151461, i(c, y + 48), 11),
							e(o(h, _, v), 530742520, i(c, y + 60), 16),
							e(o(h, _, v), 3299628645, i(c, y + 8), 23),
							e(a(h, _, v), 4096336452, i(c, y), 6),
							e(a(h, _, v), 1126891415, i(c, y + 28), 10),
							e(a(h, _, v), 2878612391, i(c, y + 56), 15),
							e(a(h, _, v), 4237533241, i(c, y + 20), 21),
							e(a(h, _, v), 1700485571, i(c, y + 48), 6),
							e(a(h, _, v), 2399980690, i(c, y + 12), 10),
							e(a(h, _, v), 4293915773, i(c, y + 40), 15),
							e(a(h, _, v), 2240044497, i(c, y + 4), 21),
							e(a(h, _, v), 1873313359, i(c, y + 32), 6),
							e(a(h, _, v), 4264355552, i(c, y + 60), 10),
							e(a(h, _, v), 2734768916, i(c, y + 24), 15),
							e(a(h, _, v), 1309151649, i(c, y + 52), 21),
							e(a(h, _, v), 4149444226, i(c, y + 16), 6),
							e(a(h, _, v), 3174756917, i(c, y + 44), 10),
							e(a(h, _, v), 718787259, i(c, y + 8), 15),
							e(a(h, _, v), 3951481745, i(c, y + 36), 21),
							(f = p(f, S)),
							(d = p(d, h)),
							(m = p(m, _)),
							(g = p(g, v));
					}
					return (function (e, n, r, o) {
						for (var a = '', i = 0, s = 0, l = 3; l >= 0; l--)
							(i = 255 & (s = arguments[l])),
								(i <<= 8),
								(i |= 255 & (s >>>= 8)),
								(i <<= 8),
								(i |= 255 & (s >>>= 8)),
								(i <<= 8),
								(a += t((i |= s >>>= 8)));
						return a;
					})(g, m, d, f).toUpperCase();
				})()
			);
		};
		var c = function (e) {
				return u.MD5(e);
			},
			f = 0;
		function p(e) {
			return m(d(g(e)));
		}
		function d(e) {
			return h(_(S(e), 8 * e.length));
		}
		function m(e) {
			for (var t, n = f ? '0123456789ABCDEF' : '0123456789abcdef', r = '', o = 0; o < e.length; o++)
				(t = e.charCodeAt(o)), (r += n.charAt((t >>> 4) & 15) + n.charAt(15 & t));
			return r;
		}
		function g(e) {
			for (var t, n, r = '', o = -1; ++o < e.length; )
				(t = e.charCodeAt(o)),
					(n = o + 1 < e.length ? e.charCodeAt(o + 1) : 0),
					55296 <= t && t <= 56319 && 56320 <= n && n <= 57343 && ((t = 65536 + ((1023 & t) << 10) + (1023 & n)), o++),
					t <= 127
						? (r += String.fromCharCode(t))
						: t <= 2047
							? (r += String.fromCharCode(192 | ((t >>> 6) & 31), 128 | (63 & t)))
							: t <= 65535
								? (r += String.fromCharCode(224 | ((t >>> 12) & 15), 128 | ((t >>> 6) & 63), 128 | (63 & t)))
								: t <= 2097151 && (r += String.fromCharCode(240 | ((t >>> 18) & 7), 128 | ((t >>> 12) & 63), 128 | ((t >>> 6) & 63), 128 | (63 & t)));
			return r;
		}
		function S(e) {
			for (var t = Array(e.length >> 2), n = 0; n < t.length; n++) t[n] = 0;
			for (n = 0; n < 8 * e.length; n += 8) t[n >> 5] |= (255 & e.charCodeAt(n / 8)) << (24 - (n % 32));
			return t;
		}
		function h(e) {
			for (var t = '', n = 0; n < 32 * e.length; n += 8) t += String.fromCharCode((e[n >> 5] >>> (24 - (n % 32))) & 255);
			return t;
		}
		function _(e, t) {
			(e[t >> 5] |= 128 << (24 - (t % 32))), (e[15 + (((t + 64) >> 9) << 4)] = t);
			for (var n = Array(80), r = 1732584193, o = -271733879, a = -1732584194, i = 271733878, s = -1009589776, l = 0; l < e.length; l += 16) {
				for (var u = r, c = o, f = a, p = i, d = s, m = 0; m < 80; m++) {
					n[m] = m < 16 ? e[l + m] : A(n[m - 3] ^ n[m - 8] ^ n[m - 14] ^ n[m - 16], 1);
					var g = T(T(A(r, 5), v(m, o, a, i)), T(T(s, n[m]), y(m)));
					(s = i), (i = a), (a = A(o, 30)), (o = r), (r = g);
				}
				(r = T(r, u)), (o = T(o, c)), (a = T(a, f)), (i = T(i, p)), (s = T(s, d));
			}
			return Array(r, o, a, i, s);
		}
		function v(e, t, n, r) {
			return e < 20 ? (t & n) | (~t & r) : e < 40 ? t ^ n ^ r : e < 60 ? (t & n) | (t & r) | (n & r) : t ^ n ^ r;
		}
		function y(e) {
			return e < 20 ? 1518500249 : e < 40 ? 1859775393 : e < 60 ? -1894007588 : -899497514;
		}
		function T(e, t) {
			var n = (65535 & e) + (65535 & t);
			return (((e >> 16) + (t >> 16) + (n >> 16)) << 16) | (65535 & n);
		}
		function A(e, t) {
			return (e << t) | (e >>> (32 - t));
		}
		var b,
			P = p,
			C = function () {
				var e = !1,
					t = '',
					n = '',
					r = '',
					o = null,
					a = 6,
					s = null,
					l = null,
					u = 0,
					f = 0,
					p = !1,
					d = !1,
					m = 0,
					g = !1,
					S = '',
					h = '',
					_ = { videoSSRC: 0, audio1SSRC: 0, audio2SSRC: 0 },
					v = !1,
					y = { OK: 200, UNAUTHORIZED: 401, NOTFOUND: 404, INVALID_RANGE: 457, NOTSERVICE: 503, DISCONNECT: 999 },
					T = 4e4,
					A = 6,
					b = '',
					C = 'Authorization: WSSE profile="UsernameToken"',
					E = [],
					I = 1,
					w = {},
					R = '',
					M = null,
					D = null,
					O = '',
					U = null,
					k = {},
					F = {},
					L = null,
					N = null,
					H = null,
					B = null,
					G = null,
					V = 'play',
					W = null,
					x = {},
					Y = [],
					z = !1,
					q = !1,
					K = 0,
					j = 0,
					X = 3,
					Z = 0,
					J = 8;
				function Q() {}
				function $(e, t) {
					var n = e.split('#')[0];
					if (n) {
						var r = new RegExp('(^|&)' + t + '=([^&]*)(&|$)'),
							o = n.match(r);
						if (null !== o) return unescape(o[2]);
					}
					return null;
				}
				function ee(o, a, s, l) {
					return e
						? (function (e, t, r, o) {
								var a = '';
								switch (e) {
									case 'OPTIONS':
									case 'TEARDOWN':
									case 'GET_PARAMETER':
									case 'SET_PARAMETERS':
										a = e + ' ' + n + ' RTSP/1.0\r\nCSeq: ' + I + '\r\n' + b + '\r\n';
										break;
									case 'DESCRIBE':
										(a = e + ' ' + n + ' RTSP/1.0\r\nCSeq: ' + I),
											!0 === d && -1 === n.indexOf('subtype=5') && (a += '\r\nRequire: www.onvif.org/ver20/backchannel'),
											(a = a + '\r\n' + b + '\r\n'),
											se(),
											le();
										break;
									case 'SETUP':
										i.log('trackID: ' + t),
											(a =
												e +
												' ' +
												n +
												'/trackID=' +
												t +
												' RTSP/1.0\r\nCSeq: ' +
												I +
												'\r\n' +
												b +
												'Transport: DH/AVP/TCP;unicast;interleaved=' +
												2 * t +
												'-' +
												(2 * t + 1) +
												'\r\n'),
											(a += 0 != D ? 'Session: ' + D + '\r\n\r\n' : '\r\n'),
											se(),
											le();
										break;
									case 'PLAY':
										(a = e + ' ' + n + ' RTSP/1.0\r\nCSeq: ' + I + '\r\nSession: ' + D + ';timeout=60\r\n'),
											void 0 != o && o >= 0 ? ((a += 'Range: npt=' + o + '-\r\n'), (a += b + '\r\n')) : (a += b + '\r\n'),
											se(),
											le(),
											(Z = setTimeout(function () {
												Z && (clearTimeout(Z), (Z = 0)),
													K && (clearTimeout(K), (K = 0)),
													j && (clearTimeout(j), (j = 0)),
													B({ errorCode: '409', description: 'Rtsp Not Response' });
											}, 1e3 * J));
										break;
									case 'PAUSE':
										a = e + ' ' + n + ' RTSP/1.0\r\nCSeq: ' + I + '\r\nSession: ' + D + '\r\n\r\n';
										break;
									case 'SCALE':
										(a = 'PLAY ' + n + ' RTSP/1.0\r\nCSeq: ' + I + '\r\nSession: ' + D + '\r\n'),
											(a += o < 8 ? 'Speed: ' + o + '\r\n' : 'Scale: ' + o + '\r\n'),
											(a += b + '\r\n');
								}
								return a;
							})(o, a, 0, l)
						: (function (e, o, a, i) {
								var s = '',
									l = '',
									u = c(F.username + ':' + S + ':' + F.password),
									f = t.split('://')[1].split('/')[0].split(':')[0] + ':8086',
									p = !1;
								if (g) {
									var h = $(r, 'beginTime'),
										_ = $(r, 'endTime'),
										v = h ? h.replace(/-|:|\s/g, '_') : '',
										y = _ ? _.replace(/-|:|\s/g, '_') : '';
									0 != v.length && 0 != y.length && (p = !0);
								}
								var T = r && r.replace(/&beginTime=\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}&endTime=\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}/, '');
								switch (e) {
									case 'PLAY':
										var A = (function () {
												for (var e = [], t = 0; t < 32; t++) e.push(String.fromCharCode((256 * Math.random()) | 0));
												return c(e.join(''));
											})(),
											E = (function () {
												var e = new Date(),
													t = e.getTimezoneOffset(),
													n = e.getTime() + 60 * t * 1e3,
													r = new Date(n),
													o = r.getFullYear(),
													a = r.getMonth() + 1,
													i = r.getDate(),
													s = r.getHours(),
													l = r.getMinutes(),
													u = r.getSeconds(),
													c = function (e) {
														return e < 10 ? '0' + e : e;
													};
												return o + '-' + c(a) + '-' + c(i) + 'T' + c(s) + ':' + c(l) + ':' + c(u) + 'Z';
											})(),
											w = (function (e) {
												for (
													var t, n, r, o, a, i, s, l = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=', u = '', c = 0;
													c < e.length;

												)
													(t = e[c++]),
														(n = e[c++]),
														(r = e[c++]),
														(o = t >> 2),
														(a = ((3 & t) << 4) | (n >> 4)),
														(i = ((15 & n) << 2) | (r >> 6)),
														(s = 63 & r),
														isNaN(n) ? (i = s = 64) : isNaN(r) && (s = 64),
														(u = u + l.charAt(o) + l.charAt(a) + l.charAt(i) + l.charAt(s));
												return u;
											})(
												(function (e) {
													var t,
														n = e.trim(),
														r = '0x' === n.substr(0, 2).toLowerCase() ? n.substr(2) : n,
														o = r.length;
													if (o % 2 !== 0) return '';
													for (var a = [], i = 0; i < o; i += 2) (t = parseInt(r.substr(i, 2), 16)), a.push(t);
													return a;
												})(P(A + E + u.toUpperCase()))
											);
										(s =
											'GET ' +
											n +
											(p ? '&starttime='.concat(v, '&endtime=').concat(y, '&') : '&') +
											'method=0' +
											(T.length > 0 ? '?sourceId='.concat(T) : '') +
											' HTTP/1.1\r\n'),
											(s += 'Accept-Sdp: Private\r\n'),
											(s += b + '\r\n'),
											(s += 'Connection: keep-alive\r\nCseq: ' + I + '\r\nHost: ' + f + '\r\n'),
											i
												? (s += 'Range: npt=' + i + '-\r\n')
												: m
													? (s += 'Range: npt=' + m + '-\r\n')
													: 'ContinuePlay' !== R && (s += 'Range: npt=0.000000-\r\n'),
											d &&
												((l += 'v=0\r\n'),
												(l += 'o=- 2208989105 2208989105 IN IP4 0.0.0.0\r\n'),
												(l += 's=Media Server\r\n'),
												(l += 'c=IN IP4 0.0.0.0\r\n'),
												(l += 't=0 0\r\n'),
												(l += 'a=control:*\r\n'),
												(l += 'a=packetization-supported:DH\r\n'),
												(l += 'a=rtppayload-supported:DH\r\n'),
												(l += 'a=range:npt=now-\r\n'),
												(l += 'm=audio 0 RTP/AVP 8\r\n'),
												(l += 'a=control:trackID=5\r\n'),
												(l += 'a=rtpmap:8 PCMA/16000\r\n'),
												(s += 'Private-Length: ' + (l += 'a=sendonly\r\n').length + '\r\n'),
												(s += 'Private-Type: application/sdp\r\n')),
											(s +=
												b === C
													? 'WSSE: UsernameToken Username="' +
														F.username +
														'", PasswordDigest="' +
														w +
														'", Nonce="' +
														A +
														'", Created="' +
														E +
														'"\r\n\r\n'
													: '\r\n'),
											(s += l);
										break;
									case 'PAUSE':
										(s =
											'GET ' +
											n +
											(p ? '&starttime='.concat(v, '&endtime=').concat(y, '&') : '&') +
											'method=1' +
											(T.length > 0 ? '?sourceId='.concat(T) : '') +
											' HTTP/1.1\r\n'),
											(s += 'Connection: keep-alive\r\nCseq: ' + I + '\r\nHost: ' + f + '\r\n\r\n');
										break;
									case 'KEEP_LIVE':
										(s =
											'GET ' +
											n +
											(p ? '&starttime='.concat(v, '&endtime=').concat(y, '&') : '&') +
											'method=2' +
											(T.length > 0 ? '?sourceId='.concat(T) : '') +
											' HTTP/1.1\r\n'),
											(s += 'Connection: keep-alive\r\nCseq: ' + I + '\r\nHost: ' + f + '\r\n\r\n');
										break;
									case 'STOP':
									case 'TEARDOWN':
										(s = 'GET ' + n + (p ? '&starttime='.concat(v, '&endtime=').concat(y, '&') : '&') + 'method=3?sourceId=' + T + ' HTTP/1.1\r\n'),
											(s += 'Connection: keep-alive\r\nCseq: ' + I + '\r\nHost: ' + f + '\r\n\r\n');
										break;
									case 'SCALE':
										(s =
											'GET ' +
											n +
											(p ? '&starttime='.concat(v, '&endtime=').concat(y, '&') : '&') +
											'method=0' +
											(T.length > 0 ? '?sourceId='.concat(T) : '') +
											' HTTP/1.1\r\n'),
											(s += i < 8 ? 'Speed: ' + i + '\r\n' : 'Scale: ' + i + '\r\n'),
											(s += 'Connection: keep-alive\r\nCseq: ' + I + '\r\nHost: ' + f + '\r\n\r\n');
								}
								return s;
							})(o, 0, 0, l);
				}
				function te(t) {
					i.log(t);
					var r,
						a = t.search('CSeq: ') + 5;
					if (
						((I = parseInt(t.slice(a, a + 10)) + 1),
						(r = (function (e) {
							var t = {},
								n = 0,
								r = 0,
								o = null,
								a = null;
							if (-1 !== e.search('Content-Type: application/sdp')) {
								var i = e.split('\r\n\r\n');
								a = i[0];
							} else a = e;
							var s = a.split('\r\n'),
								l = s[0].split(' ');
							if ((l.length > 2 && ((t.ResponseCode = parseInt(l[1])), (t.ResponseMessage = l[2])), t.ResponseCode === y.OK)) {
								for (n = 1; n < s.length; n++)
									if ('Public' === (o = s[n].split(':'))[0]) t.MethodsSupported = o[1].split(',');
									else if ('CSeq' === o[0]) t.CSeq = parseInt(o[1]);
									else if ('Content-Type' === o[0]) (t.ContentType = o[1]), -1 !== t.ContentType.search('application/sdp') && (t.SDPData = ce(e));
									else if ('Content-Length' === o[0]) t.ContentLength = parseInt(o[1]);
									else if ('Content-Base' === o[0]) {
										var u = s[n].search('Content-Base:');
										-1 !== u && (t.ContentBase = s[n].substr(u + 13));
									} else if ('Session' === o[0]) {
										var c = o[1].split(';');
										t.SessionID = parseInt(c[0]);
									} else if ('Transport' === o[0]) {
										var f = o[1].split(';');
										for (r = 0; r < f.length; r++) {
											var p = f[r].search('interleaved=');
											if (-1 !== p) {
												var d = f[r].substr(p + 12),
													m = d.split('-');
												m.length > 1 && ((t.RtpInterlevedID = parseInt(m[0])), (t.RtcpInterlevedID = parseInt(m[1])));
											}
										}
									} else if ('RTP-Info' === o[0]) {
										o[1] = s[n].substr(9);
										var g = o[1].split(',');
										for (t.RTPInfoList = [], r = 0; r < g.length; r++) {
											var S = g[r].split(';'),
												h = {},
												_ = 0;
											for (_ = 0; _ < S.length; _++) {
												var v = S[_].search('url=');
												-1 !== v && (h.URL = S[_].substr(v + 4)), -1 !== (v = S[_].search('seq=')) && (h.Seq = parseInt(S[_].substr(v + 4)));
											}
											t.RTPInfoList.push(h);
										}
									}
							} else if (t.ResponseCode === y.UNAUTHORIZED)
								for (n = 1; n < s.length; n++)
									if ('CSeq' === (o = s[n].split(':'))[0]) t.CSeq = parseInt(o[1]);
									else if ('WWW-Authenticate' === o[0]) {
										var T = o[1].split(',');
										for (r = 0; r < T.length; r++) {
											var A = T[r].search('Digest realm=');
											if (-1 !== A) {
												var b = T[r].substr(A + 13).split('"');
												t.Realm = b[1];
											}
											if (-1 !== (A = T[r].search('nonce='))) {
												var P = T[r].substr(A + 6).split('"');
												t.Nonce = P[1];
											}
										}
									}
							return t;
						})(t)).ResponseCode === y.UNAUTHORIZED &&
							((e && '' === b) || (!e && b === C)))
					)
						!(function (t) {
							var r = F.username,
								o = F.password,
								a = { Method: null, Realm: null, Nonce: null, Uri: null },
								i = null;
							(a = { Method: R.toUpperCase(), Realm: t.Realm, Nonce: t.Nonce, Uri: n }),
								(i = (function (e, t, n, r, o, a) {
									var i = null,
										s = null;
									return (i = c(e + ':' + r + ':' + t).toLowerCase()), (s = c(a + ':' + n).toLowerCase()), c(i + ':' + o + ':' + s).toLowerCase();
								})(r, o, a.Uri, a.Realm, a.Nonce, a.Method)),
								(b = 'Authorization: Digest username="' + r + '", realm="' + a.Realm + '",'),
								(b += ' nonce="' + a.Nonce + '", uri="' + a.Uri + '", response="' + i + '"'),
								e ? ((b += '\r\n'), re(ee('OPTIONS', null))) : re(ee('PLAY', null));
						})(r);
					else if (r.ResponseCode === y.OK)
						if ('UnAuthorized' === R) {
							(w = ce(t)), 'undefined' !== typeof r.ContentBase && (w.ContentBase = r.ContentBase);
							var s = 0;
							for (s = 0; s < w.Sessions.length; s += 1) {
								var l = {};
								'JPEG' === w.Sessions[s].CodecMime ||
								'H264' === w.Sessions[s].CodecMime ||
								'H265' === w.Sessions[s].CodecMime ||
								'H264-SVC' == w.Sessions[s].CodecMime ||
								'RAW' == w.Sessions[s].CodecMime
									? ((l.codecName = w.Sessions[s].CodecMime),
										'H264-SVC' === w.Sessions[s].CodecMime && (l.codecName = 'H264'),
										'H265' === w.Sessions[s].CodecMime || w.Sessions[s].CodecMime,
										(l.trackID = w.Sessions[s].ControlURL),
										(l.ClockFreq = w.Sessions[s].ClockFreq),
										(l.Port = parseInt(w.Sessions[s].Port)),
										'undefined' !== typeof w.Sessions[s].Framerate && (l.Framerate = parseInt(w.Sessions[s].Framerate)),
										E.push(l))
									: 'PCMU' === w.Sessions[s].CodecMime ||
										  -1 !== w.Sessions[s].CodecMime.search('G726-16') ||
										  -1 !== w.Sessions[s].CodecMime.search('G726-24') ||
										  -1 !== w.Sessions[s].CodecMime.search('G726-32') ||
										  -1 !== w.Sessions[s].CodecMime.search('G726-40') ||
										  'PCMA' === w.Sessions[s].CodecMime ||
										  -1 !== w.Sessions[s].CodecMime.search('G723.1') ||
										  -1 !== w.Sessions[s].CodecMime.search('G729') ||
										  -1 !== w.Sessions[s].CodecMime.search('MPA') ||
										  -1 !== w.Sessions[s].CodecMime.search('L16')
										? ('PCMU' === w.Sessions[s].CodecMime
												? (l.codecName = 'G.711Mu')
												: 'G726-16' === w.Sessions[s].CodecMime
													? (l.codecName = 'G.726-16')
													: 'G726-24' === w.Sessions[s].CodecMime
														? (l.codecName = 'G.726-24')
														: 'G726-32' === w.Sessions[s].CodecMime
															? (l.codecName = 'G.726-32')
															: 'G726-40' === w.Sessions[s].CodecMime
																? (l.codecName = 'G.726-40')
																: 'PCMA' === w.Sessions[s].CodecMime
																	? (l.codecName = 'G.711A')
																	: 'G723.1' === w.Sessions[s].CodecMime
																		? (l.codecName = 'G.723')
																		: 'G729' === w.Sessions[s].CodecMime
																			? (l.codecName = 'G.729')
																			: 'MPA' === w.Sessions[s].CodecMime
																				? (l.codecName = 'mpeg2')
																				: 'L16' === w.Sessions[s].CodecMime && (l.codecName = 'PCM'),
											(l.trackID = w.Sessions[s].ControlURL),
											(l.ClockFreq = w.Sessions[s].ClockFreq),
											(l.Port = parseInt(w.Sessions[s].Port)),
											(l.Bitrate = parseInt(w.Sessions[s].Bitrate)),
											(l.TalkTransType = w.Sessions[s].TalkTransType),
											E.push(l))
										: 'mpeg4-generic' === w.Sessions[s].CodecMime || 'MPEG4-GENERIC' === w.Sessions[s].CodecMime
											? ((l.codecName = 'mpeg4-generic'),
												(l.trackID = w.Sessions[s].ControlURL),
												(l.ClockFreq = w.Sessions[s].ClockFreq),
												(l.Port = parseInt(w.Sessions[s].Port)),
												(l.Bitrate = parseInt(w.Sessions[s].Bitrate)),
												(l.TalkTransType = w.Sessions[s].TalkTransType),
												E.push(l))
											: 'vnd.onvif.metadata' === w.Sessions[s].CodecMime
												? ((l.codecName = 'MetaData'),
													(l.trackID = w.Sessions[s].ControlURL),
													(l.ClockFreq = w.Sessions[s].ClockFreq),
													(l.Port = parseInt(w.Sessions[s].Port)),
													E.push(l))
												: 'stream-assist-frame' === w.Sessions[s].CodecMime
													? ((l.codecName = 'stream-assist-frame'),
														(l.trackID = w.Sessions[s].ControlURL),
														(l.ClockFreq = w.Sessions[s].ClockFreq),
														(l.Port = parseInt(w.Sessions[s].Port)),
														E.push(l))
													: ('audio' === w.Sessions[s].Type && B({ errorCode: 201, description: 'Audio format not supported' }),
														i.log('Unknown codec type:', w.Sessions[s].CodecMime, w.Sessions[s].ControlURL));
							}
							for (var u = 0; u < E.length; u++) E[u].RtpInterlevedID = 2 * (E[u].trackID.split('=')[1] - 0);
							(M = 0),
								clearInterval(U),
								(U = setInterval(function () {
									return (
										'GET_PARAMETER' === V && 'PAUSE' != R ? f++ : (f = 0),
										f === A && ((o.fileOver = !0), fe(), N(), B({ errorCode: '999', description: 'no rtsv response' })),
										re(ee('KEEP_LIVE', null))
									);
								}, T)),
								(R = 'Playing');
						} else {
							if ('Options' === R) return (R = 'Describe'), ee('DESCRIBE', null);
							if ('Describe' === R) {
								for (w = ce(t), 'undefined' !== typeof r.ContentBase && (w.ContentBase = r.ContentBase), s = 0, s = 0; s < w.Sessions.length; s += 1)
									(l = {}),
										'JPEG' === w.Sessions[s].CodecMime ||
										'H264' === w.Sessions[s].CodecMime ||
										'H265' === w.Sessions[s].CodecMime ||
										'H264-SVC' == w.Sessions[s].CodecMime
											? ((l.codecName = w.Sessions[s].CodecMime),
												'H264-SVC' == w.Sessions[s].CodecMime && (l.codecName = 'H264'),
												w.Sessions[s].CodecMime,
												(l.trackID = w.Sessions[s].ControlURL),
												(l.ClockFreq = w.Sessions[s].ClockFreq),
												(l.Port = parseInt(w.Sessions[s].Port)),
												'undefined' !== typeof w.Sessions[s].Framerate && (l.Framerate = parseInt(w.Sessions[s].Framerate)),
												E.push(l))
											: 'PCMU' === w.Sessions[s].CodecMime ||
												  -1 !== w.Sessions[s].CodecMime.search('G726-16') ||
												  -1 !== w.Sessions[s].CodecMime.search('G726-24') ||
												  -1 !== w.Sessions[s].CodecMime.search('G726-32') ||
												  -1 !== w.Sessions[s].CodecMime.search('G726-40') ||
												  'PCMA' === w.Sessions[s].CodecMime ||
												  -1 !== w.Sessions[s].CodecMime.search('G723.1') ||
												  -1 !== w.Sessions[s].CodecMime.search('G729') ||
												  -1 !== w.Sessions[s].CodecMime.search('MPA') ||
												  -1 !== w.Sessions[s].CodecMime.search('L16')
												? ('PCMU' === w.Sessions[s].CodecMime
														? (l.codecName = 'G.711Mu')
														: 'G726-16' === w.Sessions[s].CodecMime
															? (l.codecName = 'G.726-16')
															: 'G726-24' === w.Sessions[s].CodecMime
																? (l.codecName = 'G.726-24')
																: 'G726-32' === w.Sessions[s].CodecMime
																	? (l.codecName = 'G.726-32')
																	: 'G726-40' === w.Sessions[s].CodecMime
																		? (l.codecName = 'G.726-40')
																		: 'PCMA' === w.Sessions[s].CodecMime
																			? (l.codecName = 'G.711A')
																			: 'G723.1' === w.Sessions[s].CodecMime
																				? (l.codecName = 'G.723')
																				: 'G729' === w.Sessions[s].CodecMime
																					? (l.codecName = 'G.729')
																					: 'MPA' === w.Sessions[s].CodecMime
																						? (l.codecName = 'mpeg2')
																						: 'L16' === w.Sessions[s].CodecMime && (l.codecName = 'PCM'),
													(l.trackID = w.Sessions[s].ControlURL),
													(l.ClockFreq = w.Sessions[s].ClockFreq),
													(l.Port = parseInt(w.Sessions[s].Port)),
													(l.Bitrate = parseInt(w.Sessions[s].Bitrate)),
													(l.TalkTransType = w.Sessions[s].TalkTransType),
													E.push(l))
												: 'mpeg4-generic' === w.Sessions[s].CodecMime || 'MPEG4-GENERIC' === w.Sessions[s].CodecMime
													? ((l.codecName = 'mpeg4-generic'),
														(l.trackID = w.Sessions[s].ControlURL),
														(l.ClockFreq = w.Sessions[s].ClockFreq),
														(l.Port = parseInt(w.Sessions[s].Port)),
														(l.Bitrate = parseInt(w.Sessions[s].Bitrate)),
														(l.TalkTransType = w.Sessions[s].TalkTransType),
														E.push(l))
													: 'vnd.onvif.metadata' === w.Sessions[s].CodecMime
														? ((l.codecName = 'MetaData'),
															(l.trackID = w.Sessions[s].ControlURL),
															(l.ClockFreq = w.Sessions[s].ClockFreq),
															(l.Port = parseInt(w.Sessions[s].Port)),
															E.push(l))
														: 'stream-assist-frame' === w.Sessions[s].CodecMime
															? ((l.codecName = 'stream-assist-frame'),
																(l.trackID = w.Sessions[s].ControlURL),
																(l.ClockFreq = w.Sessions[s].ClockFreq),
																(l.Port = parseInt(w.Sessions[s].Port)),
																E.push(l))
															: ('audio' === w.Sessions[s].Type && B({ errorCode: 201, description: 'Audio format not supported' }),
																i.log('Unknown codec type:', w.Sessions[s].CodecMime, w.Sessions[s].ControlURL));
								return (M = 0), (R = 'Setup'), Y.length ? ee('SETUP', Y[M].split('=')[1] - 0) : ee('SETUP', 0);
							}
							if ('Setup' === R)
								return (
									(D = r.SessionID),
									M < Y.length
										? (void 0 != E[M] && ((E[M].RtpInterlevedID = r.RtpInterlevedID), (E[M].RtcpInterlevedID = r.RtcpInterlevedID)),
											D ? (Y[(M += 1)] ? ee('SETUP', Y[M].split('=')[1]) : ((R = 'Play'), ee('PLAY', null))) : ee('SETUP', Y[M].split('=')[1]))
										: D
											? ((R = 'Play'), ee('PLAY', null, 0, m))
											: ((M += 1), ee('SETUP', 0))
								);
							if ('Play' === R) {
								(D = r.SessionID),
									clearInterval(U),
									(U = setInterval(function () {
										return (
											'GET_PARAMETER' === V && 'PAUSE' != R ? f++ : (f = 0),
											f === A && ((o.fileOver = !0), fe(), N(), B({ errorCode: '999', description: 'no rtsp response' })),
											re(ee('GET_PARAMETER', null))
										);
									}, T));
								var f = 0;
								(R = 'Playing'), (v = !0);
							} else 'ContinuePlay' === R ? (R = 'Playing') : 'Playing' === R || i.log('unknown rtsp state:' + R);
						}
					else if (r.ResponseCode === y.NOTSERVICE)
						if ('Setup' === R && ((e && 'sendonly' === E[M].TalkTransType) || (!e && -1 !== E[M].trackID.search('trackID=t')))) {
							if (
								((E[M].RtpInterlevedID = -1),
								(E[M].RtcpInterlevedID = -1),
								(M += 1),
								(d = !1),
								B({ errorCode: '504', description: 'Talk Service Unavilable', place: 'RtspClient.js' }),
								M < E.length)
							)
								return ee('SETUP', E[M].trackID);
							(R = 'Play'), ee('PLAY', null, 0, m);
						} else B({ errorCode: '503', description: 'Service Unavilable' });
					else if (r.ResponseCode === y.NOTFOUND) {
						if ('Describe' === R || 'Options' === R) return void B({ errorCode: 404, description: 'rtsp not found' });
					} else if (r.ResponseCode === y.INVALID_RANGE)
						return (
							('backup' !== O && 'playback' !== O) || B({ errorCode: '457', description: 'Invalid range' }), void i.log('RTP disconnection detect!!!')
						);
				}
				function ne(e) {
					null !== o && o.readyState === WebSocket.OPEN ? v && o.send(e) : i.log('SendRtpData - Websocket does not exist');
				}
				function re(t) {
					void 0 != t &&
						null != t &&
						'' != t &&
						(null !== o && o.readyState === WebSocket.OPEN
							? (e && !p && -1 !== t.search('DESCRIBE') && ((z = !0), (p = !0)), void 0 != t && o.send(oe(t)))
							: i.log('websocket\u672a\u8fde\u63a5'));
				}
				function oe(e) {
					for (var t = e.length, n = new Uint8Array(new ArrayBuffer(t)), r = 0; r < t; r++) n[r] = e.charCodeAt(r);
					return n;
				}
				function ae(e) {
					var n = e.split('//')[1].split('/')[0];
					if (t.includes('?serverIp=')) t = t.slice(0, t.indexOf('serverIp=')) + 'serverIp=' + n;
					else {
						var r = 'https:' === location.protocol ? 'wss' : 'ws';
						t = t.includes('8554') ? ''.concat(r, '://').concat(n) : e.replace('rtsp', r);
					}
				}
				function ie(i) {
					var c = new Uint8Array(i.data),
						p = new Uint8Array(c.length);
					for (p.set(c, 0), u = p.length, K && (clearTimeout(K), (K = 0)), j && (clearTimeout(j), (j = 0)); u > 0; )
						if (36 !== p[0]) {
							var d = String.fromCharCode.apply(null, p),
								m = null;
							if (d.includes('302 Moved'))
								return ae((n = d.slice(d.indexOf('rtsp://'), d.indexOf('\r\n\r\n')))), Q.prototype.disconnect(), void Q.prototype.connect(t, n, r, x);
							if (
								((-1 !== d.indexOf('OffLine:File Over') ||
									-1 !== d.indexOf('OffLine: File Over') ||
									-1 !== d.indexOf('OffLine:Internal Error') ||
									d.includes('is_session_end: true')) &&
									((o.fileOver = !0), H()),
								-1 !== d.indexOf('OffLine:Internal Error') && B({ errorCode: 500, description: 'Internal Error' }),
								-1 !== d.indexOf('OffLine:KmsUnavailable') && B({ errorCode: 203, description: 'KmsUnavailable' }),
								'Describe' === R &&
									-1 !== d.indexOf('a=control:trackID=') &&
									(Y =
										d
											.split('a=control:')
											.filter(function (e) {
												return e.startsWith('trackID=');
											})
											.map(function (e) {
												return e.split('\r\n')[0];
											}) || []),
								-1 !== d.indexOf('Range: npt='))
							) {
								var g = d.split('Range: ')[1].split('\r\n')[0],
									S = g.split('npt=')[1].split('-')[0],
									v = g.split('-')[1];
								G(v - S);
							}
							var y = d.indexOf('interleaved=');
							if (-1 != y) {
								var T = d.slice(y),
									A = T.indexOf('-');
								if (-1 != A) {
									var b = T.slice(12, A);
									if (((b /= 2), -1 != (y = d.indexOf('ssrc=')))) {
										var P = d.slice(y + 5, y + 5 + 8),
											C = parseInt(P, 16);
										0 != C && (0 == b ? (_.videoSSRC = C) : 1 == b ? (_.audio1SSRC = C) : 2 == b && (_.audio2SSRC = C));
									}
								}
							}
							z || (!q && -1 !== d.indexOf('200 OK')) ? (z && (h = d), (m = d.lastIndexOf('\r\n')), (z = !1), (q = !0)) : (m = d.search('\r\n\r\n'));
							var E = -1;
							if (-1 === (E = e ? d.search('RTSP') : d.search('HTTP'))) return void (p = new Uint8Array());
							if (-1 === m) return void (u = p.length);
							(s = p.subarray(E, m + a)), (p = p.subarray(m + a)), re(te(String.fromCharCode.apply(null, s))), (u = p.length);
						} else {
							if (
								((V = 'PLAY'),
								clearTimeout(W),
								(W = setTimeout(function () {
									V = 'GET_PARAMETER';
								}, 1e4)),
								(l = p.subarray(0, a)),
								!((f = (l[2] << 24) | (l[3] << 16) | (l[4] << 8) | l[5]) + a <= p.length))
							)
								return void (u = p.length);
							var I = p.subarray(a, f + a);
							ue(0, I), (p = p.subarray(f + a)), (u = p.length);
						}
				}
				function se() {
					K && clearTimeout(K),
						Z && (clearTimeout(Z), (Z = 0)),
						(K = setTimeout(function () {
							B({ errorCode: '407', description: 'Request Timeout' });
						}, 3e4));
				}
				function le() {
					j && clearTimeout(j),
						(j = setTimeout(function () {
							Z && (clearTimeout(Z), (Z = 0)), B({ errorCode: '408', description: 'Short Request Timeout' });
						}, 1e3 * X));
				}
				function ue(e, t) {
					Z && (clearTimeout(Z), (Z = 0)), L(t);
				}
				function ce(t) {
					var n = { Sessions: [] },
						r = (
							-1 !== t.search('Content-Type: application/sdp') || -1 !== t.search('Private-Type: application/sdp') ? t.split('\r\n\r\n')[1] : t
						).split('\r\n'),
						o = 0,
						a = !1;
					for (o = 0; o < r.length; o++) {
						var i = r[o].split('=');
						if (i.length > 0)
							switch (i[0]) {
								case 'a':
									var s = i[1].split(':');
									if (s.length > 1) {
										if ('control' === s[0]) {
											var l = r[o].search('control:');
											!0 === a
												? -1 !== l && (n.Sessions[n.Sessions.length - 1].ControlURL = r[o].substr(l + 8))
												: -1 !== l && (n.BaseURL = r[o].substr(l + 8));
										} else if ('rtpmap' === s[0]) {
											var u = s[1].split(' ');
											n.Sessions[n.Sessions.length - 1].PayloadType = u[0];
											var c = u[1].split('/');
											(n.Sessions[n.Sessions.length - 1].CodecMime = c[0]), c.length > 1 && (n.Sessions[n.Sessions.length - 1].ClockFreq = c[1]);
										} else if ('framesize' === s[0]) {
											var f = s[1].split(' ');
											if (f.length > 1) {
												var p = f[1].split('-');
												(n.Sessions[n.Sessions.length - 1].Width = p[0]), (n.Sessions[n.Sessions.length - 1].Height = p[1]);
											}
										} else if ('framerate' === s[0]) n.Sessions[n.Sessions.length - 1].Framerate = s[1];
										else if ('fmtp' === s[0]) {
											var m = r[o].split(' ');
											if (m.length < 2) continue;
											for (var g = 1; g < m.length; g++) {
												var S = m[g].split(';'),
													h = 0;
												for (h = 0; h < S.length; h++) {
													var _ = S[h].search('mode=');
													if (
														(-1 !== _ && (n.Sessions[n.Sessions.length - 1].mode = S[h].substr(_ + 5)),
														-1 !== (_ = S[h].search('config=')) &&
															((n.Sessions[n.Sessions.length - 1].config = S[h].substr(_ + 7)),
															(k.config = n.Sessions[n.Sessions.length - 1].config),
															(k.clockFreq = n.Sessions[n.Sessions.length - 1].ClockFreq),
															(k.bitrate = n.Sessions[n.Sessions.length - 1].Bitrate)),
														-1 !== (_ = S[h].search('sprop-vps=')) && (n.Sessions[n.Sessions.length - 1].VPS = S[h].substr(_ + 10)),
														-1 !== (_ = S[h].search('sprop-sps=')) && (n.Sessions[n.Sessions.length - 1].SPS = S[h].substr(_ + 10)),
														-1 !== (_ = S[h].search('sprop-pps=')) && (n.Sessions[n.Sessions.length - 1].PPS = S[h].substr(_ + 10)),
														-1 !== (_ = S[h].search('sprop-parameter-sets=')))
													) {
														var v = S[h].substr(_ + 21).split(',');
														v.length > 1 && ((n.Sessions[n.Sessions.length - 1].SPS = v[0]), (n.Sessions[n.Sessions.length - 1].PPS = v[1]));
													}
												}
											}
										}
									} else
										1 === s.length &&
											('recvonly' === s[0]
												? (n.Sessions[n.Sessions.length - 1].TalkTransType = 'recvonly')
												: 'sendonly' === s[0] && (n.Sessions[n.Sessions.length - 1].TalkTransType = 'sendonly'));
									break;
								case 'm':
									var y = i[1].split(' '),
										T = {};
									(T.Type = y[0]), (T.Port = y[1]), (T.Payload = y[3]), n.Sessions.push(T), (a = !0);
									break;
								case 'b':
									if (!0 === a) {
										var A = i[1].split(':');
										n.Sessions[n.Sessions.length - 1].Bitrate = A[1];
									}
							}
					}
					if (!e && d)
						for (var b = 0; b < n.Sessions.length; b += 1)
							('1' !== n.Sessions[b].ControlURL.split('=')[1] && '2' !== n.Sessions[b].ControlURL.split('=')[1]) || n.Sessions.splice(b, 1);
					return n;
				}
				function fe() {
					re(ee('TEARDOWN', null)),
						clearInterval(U),
						(U = null),
						null !== o && (o.onerror = null),
						null !== o && o.readyState === WebSocket.OPEN && (o.close(), (o = null), (D = null));
				}
				return (
					(Q.prototype = {
						connect: function (a, i, s, l) {
							(x = l),
								(e = l.bRtspFlag),
								(g = l.bPlayBack),
								(X = l.nShortTimeout || 3),
								(J = l.nRtspResponseTimeout || 8),
								(R = e ? 'Options' : 'UnAuthorized'),
								o ||
									((t = a),
									(n = i),
									(r = s),
									(d = l.bTalkService),
									(m = l.nRange),
									((o = new WebSocket(t)).binaryType = 'arraybuffer'),
									(o.fileOver = !1),
									o.addEventListener('message', ie, !1),
									(o.onopen = function () {
										if (e) {
											var t = 'OPTIONS ' + n + ' RTSP/1.0\r\nCSeq: ' + I + '\r\n';
											t += 'User-Agent: PlaySDK Client/1.0\r\n';
											var r = oe((t += '\r\n'));
											o.send(r);
										} else (b = C), re(ee('PLAY', null));
									}),
									(o.onerror = function (e) {
										B({ errorCode: 202, description: 'Open WebSocket Error' });
									}),
									(o.onclose = function (e) {
										o && !o.fileOver && B({ errorCode: 202, description: 'Open WebSocket Error' });
									}));
						},
						disconnect: function () {
							re(ee('TEARDOWN', null)),
								clearInterval(U),
								(U = null),
								null !== o && (o.onerror = null),
								null !== o && o.readyState === WebSocket.OPEN && (o.close(), (o = null), (D = null));
						},
						controlPlayer: function (e) {
							var t = '';
							switch ((e.command, e.command)) {
								case 'PLAY':
									if (((R = 'Play'), null != e.range)) {
										t = ee('PLAY', null, 0, e.range);
										break;
									}
									t = ee('PLAY', null);
									break;
								case 'PLAY_SEEK':
									t = ee('PLAY', null, 0, e.data);
									break;
								case 'PAUSE':
									if ('PAUSE' === R) break;
									(R = 'PAUSE'), (t = ee('PAUSE', null));
									break;
								case 'SCALE':
									t = ee('SCALE', null, 0, e.data);
									break;
								case 'TEARDOWN':
									t = ee('TEARDOWN', null);
									break;
								default:
									i.log('\u672a\u77e5\u6307\u4ee4: ' + e.command);
							}
							'' != t && re(t);
						},
						setRTSPURL: function (e) {
							n = e;
						},
						setCallback: function (e, t) {
							switch (e) {
								case 'Disconnect':
									N = t;
									break;
								case 'PlayBackStreamRange':
									G = t;
									break;
								case 'Error':
									B = t;
							}
						},
						setUserInfo: function (e, t) {
							(F.username = e), (F.password = t);
						},
						setRtpDataCallback: function (e) {
							L = e;
						},
						setStreamFinishCallback: function (e) {
							H = e;
						},
						sendRtpData: function (e) {
							ne(e);
						},
						GetSdpInfo: function () {
							return h;
						},
						GetSSRC: function () {
							return _;
						},
					}),
					new Q()
				);
			};
		function E(e, t) {
			return (
				(function (e) {
					if (Array.isArray(e)) return e;
				})(e) ||
				(function (e, t) {
					if ('undefined' === typeof Symbol || !(Symbol.iterator in Object(e))) return;
					var n = [],
						r = !0,
						o = !1,
						a = void 0;
					try {
						for (var i, s = e[Symbol.iterator](); !(r = (i = s.next()).done) && (n.push(i.value), !t || n.length !== t); r = !0);
					} catch (e) {
						(o = !0), (a = e);
					} finally {
						try {
							r || null == s.return || s.return();
						} finally {
							if (o) throw a;
						}
					}
					return n;
				})(e, t) ||
				(function (e, t) {
					if (!e) return;
					if ('string' === typeof e) return I(e, t);
					var n = Object.prototype.toString.call(e).slice(8, -1);
					'Object' === n && e.constructor && (n = e.constructor.name);
					if ('Map' === n || 'Set' === n) return Array.from(e);
					if ('Arguments' === n || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return I(e, t);
				})(e, t) ||
				(function () {
					throw new TypeError(
						'Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.'
					);
				})()
			);
		}
		function I(e, t) {
			(null == t || t > e.length) && (t = e.length);
			for (var n = 0, r = new Array(t); n < t; n++) r[n] = e[n];
			return r;
		}
		var w = function () {
				var e = null,
					t = !1,
					n = !1,
					r = null,
					o = null;
				function a() {}
				return (
					(a.prototype = {
						StartStream: function (a, i) {
							return (
								void 0 == a.strDeviceID && (a.strDeviceID = 0),
								(t = i)
									? (function (e, t, n, r, o, a) {
											var i = b.intArrayFromString(t).concat(0),
												s = b._malloc(i.length);
											b.HEAPU8.set(i, s);
											var l = b.intArrayFromString(n).concat(0),
												u = b._malloc(l.length);
											b.HEAPU8.set(l, u);
											var c = b.intArrayFromString(r).concat(0),
												f = b._malloc(c.length);
											b.HEAPU8.set(c, f);
											b._RTSP_StartStream(e, s, u, f, o, a);
											b._free(s), b._free(u), b._free(f);
										})((e = (b = window.SCModule)._RTSP_InitSession()), a.strRtspvUrl, a.strRtspvUri, a.strDeviceID, a.bTalkService, !1)
									: ((void 0 != a.nAudioType && void 0 != a.nFrequency && void 0 != a.nChannelNum) ||
											((a.nAudioType = 14), (a.nFrequency = 8e3), (a.nChannelNum = 1)),
										(function (e, t, n, r, o, a, i, s, l, u, c) {
											var f = b.intArrayFromString(t).concat(0),
												p = b._malloc(f.length);
											b.HEAPU8.set(f, p);
											var d = b.intArrayFromString(n).concat(0),
												m = b._malloc(d.length);
											b.HEAPU8.set(d, m);
											var g = b.intArrayFromString(r).concat(0),
												S = b._malloc(g.length);
											if ((b.HEAPU8.set(g, S), o && b._RTSV_InitTalkInfo(e, a, i, s), l)) {
												var h = b.intArrayFromString(u).concat(0),
													_ = b._malloc(h.length);
												b.HEAPU8.set(h, _);
												var v = b.intArrayFromString(c).concat(0),
													y = b._malloc(v.length);
												b.HEAPU8.set(v, y), b._RTSV_SetWSSEInfo(e, l, _, y), b._free(_), b._free(y);
											}
											b._RTSV_StartStream(e, p, m, S);
											b._free(p), b._free(m), b._free(S);
										})(
											(e = (b = window.SCModule)._RTSV_InitSession()),
											a.strRtspvUrl,
											a.strRtspvUri,
											a.strDeviceID,
											a.bTalkService,
											a.nAudioType,
											a.nFrequency,
											a.nChannelNum,
											!1,
											null,
											null
										)),
								(n = a.bTalkService) && ((r = b._malloc(10240)), (o = new Uint8Array(b.HEAPU8.buffer, r, 10240))),
								e
							);
						},
						StopStream: function () {
							var a;
							t
								? ((a = e), b._RTSP_StopStream(a))
								: (function (e) {
										b._RTSV_StopStream(e);
									})(e),
								(e = null),
								n && ((o = null), b._free(r));
						},
						PauseStream: function (n) {
							var r;
							n
								? t
									? ((r = e), b._RTSP_PauseStream(r))
									: (function (e) {
											b._RTSV_PauseStream(e);
										})(e)
								: t
									? (function (e) {
											b._RTSP_ResumeStream(e);
										})(e)
									: (function (e) {
											b._RTSV_ResumeStream(e);
										})(e);
						},
						PlayControl: function (n, r, o) {
							t
								? (function (e, t, n, r, o) {
										b._RTSP_PlayControl(e, t, n, r, o);
									})(e, n, r, o, !1)
								: (function (e, t, n, r, o) {
										b._RTSV_PlayControl(e, t, n, r, o);
									})(e, n, r, o, !1);
						},
						PutStream: function (n) {
							if (null != o)
								if (t)
									o.set(n),
										(function (e, t, n, r) {
											b._RTSP_PutStream(e, t, n, r);
										})(e, o.byteOffset, n.length, 5);
								else {
									var r = n.subarray(6);
									o.set(r),
										(function (e, t, n, r) {
											b._RTSV_PutStream(e, t, n, r);
										})(e, o.byteOffset, r.length, 5);
								}
						},
						GetPlayInfo: function () {
							var n = 0;
							if (t) {
								var r = E(
										(function (e) {
											var t = b._malloc(8),
												n = b._malloc(8);
											b._RTSP_GetPlayInfo(e, t, n);
											var r = b.HEAPF64[t >> 3],
												o = b.HEAPF64[n >> 3];
											return b._free(t), b._free(n), [r, o];
										})(e),
										2
									),
									o = r[0];
								n = r[1] - o;
							}
							return n;
						},
						SetMsgWaitTimeout: function (n) {
							t
								? (function (e, t) {
										b._RTSP_SetMsgTimeout(e, t);
									})(e, n)
								: (function (e, t) {
										b._RTSV_SetMsgTimeout(e, t);
									})(e, n);
						},
					}),
					new a()
				);
			},
			R = function (e) {
				var t = [],
					n = {},
					r = e;
				function o() {
					for (var e in t) t[e] = [e.charCodeAt(0), e.charCodeAt(1), e.charCodeAt(2), e.charCodeAt(3)];
					0,
						1 == r
							? (n.FTYP = new Uint8Array([105, 115, 111, 109, 0, 0, 0, 1, 105, 115, 111, 109, 97, 118, 99, 49]))
							: 2 == r &&
								(n.FTYP = new Uint8Array([105, 115, 111, 109, 0, 0, 2, 0, 105, 115, 111, 109, 105, 115, 111, 50, 97, 118, 99, 49, 109, 112, 52, 49])),
						(n.STSD_PREFIX = new Uint8Array([0, 0, 0, 0, 0, 0, 0, 1])),
						(n.STTS = new Uint8Array([0, 0, 0, 0, 0, 0, 0, 0])),
						(n.STSC = n.STCO = n.STTS),
						(n.STSZ = new Uint8Array([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0])),
						(n.HDLR_VIDEO = new Uint8Array([
							0, 0, 0, 0, 0, 0, 0, 0, 118, 105, 100, 101, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 86, 105, 100, 101, 111, 72, 97, 110, 100, 108, 101, 114,
							0,
						])),
						(n.HDLR_AUDIO = new Uint8Array([
							0, 0, 0, 0, 0, 0, 0, 0, 115, 111, 117, 110, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 83, 111, 117, 110, 100, 72, 97, 110, 100, 108, 101, 114,
							0,
						])),
						(n.DREF = new Uint8Array([0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 12, 117, 114, 108, 32, 0, 0, 0, 1])),
						(n.SMHD = new Uint8Array([0, 0, 0, 0, 0, 0, 0, 0])),
						(n.VMHD = new Uint8Array([0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0]));
				}
				t = {
					avc1: [],
					avcC: [],
					btrt: [],
					dinf: [],
					dref: [],
					esds: [],
					ftyp: [],
					hdlr: [],
					mdat: [],
					mdhd: [],
					mdia: [],
					mfhd: [],
					minf: [],
					moof: [],
					moov: [],
					mp4a: [],
					mvex: [],
					mvhd: [],
					sdtp: [],
					stbl: [],
					stco: [],
					stsc: [],
					stsd: [],
					stsz: [],
					stts: [],
					tfdt: [],
					tfhd: [],
					traf: [],
					trak: [],
					trun: [],
					trex: [],
					tkhd: [],
					vmhd: [],
					smhd: [],
					hev1: [],
					hvcC: [],
				};
				var a = function (e) {
						for (var t = 8, n = Array.prototype.slice.call(arguments, 1), r = 0; r < n.length; r++) t += n[r].byteLength;
						var o = new Uint8Array(t),
							a = 0;
						(o[a++] = (t >>> 24) & 255), (o[a++] = (t >>> 16) & 255), (o[a++] = (t >>> 8) & 255), (o[a++] = 255 & t), o.set(e, a), (a += 4);
						for (r = 0; r < n.length; r++) o.set(n[r], a), (a += n[r].byteLength);
						return o;
					},
					i = function (e) {
						return a(
							t.mp4a,
							new Uint8Array([
								0,
								0,
								0,
								0,
								0,
								0,
								0,
								1,
								0,
								0,
								0,
								0,
								0,
								0,
								0,
								0,
								(65280 & e.channelcount) >> 8,
								255 & e.channelcount,
								(65280 & e.samplesize) >> 8,
								255 & e.samplesize,
								0,
								0,
								0,
								0,
								(65280 & e.samplerate) >> 8,
								255 & e.samplerate,
								0,
								0,
							]),
							(function (e) {
								var n = e.config,
									r = n.length,
									o = new Uint8Array(
										[0, 0, 0, 0, 3, 23 + r, 0, 1, 0, 4, 15 + r, 64, 21, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5].concat([r]).concat(n).concat([6, 1, 2])
									);
								return a(t.esds, o);
							})(e)
						);
					},
					s = function (e) {
						return 'audio' === e.type
							? a(t.stsd, n.STSD_PREFIX, i(e))
							: a(
									t.stsd,
									n.STSD_PREFIX,
									(function (e) {
										var n = e.vps || [],
											o = e.sps || [],
											i = e.pps || [],
											s = [],
											l = [],
											u = [],
											c = 0;
										for (c = 0; c < n.length; c++)
											s.push((65280 & n[c].byteLength) >>> 8), s.push(255 & n[c].byteLength), (s = s.concat(Array.prototype.slice.call(n[c])));
										for (c = 0; c < o.length; c++)
											l.push((65280 & o[c].byteLength) >>> 8), l.push(255 & o[c].byteLength), (l = l.concat(Array.prototype.slice.call(o[c])));
										for (c = 0; c < i.length; c++)
											u.push((65280 & i[c].byteLength) >>> 8), u.push(255 & i[c].byteLength), (u = u.concat(Array.prototype.slice.call(i[c])));
										return 1 == r
											? a(
													t.avc1,
													new Uint8Array([
														0,
														0,
														0,
														0,
														0,
														0,
														0,
														1,
														0,
														0,
														0,
														0,
														0,
														0,
														0,
														0,
														0,
														0,
														0,
														0,
														0,
														0,
														0,
														0,
														(65280 & e.width) >> 8,
														255 & e.width,
														(65280 & e.height) >> 8,
														255 & e.height,
														0,
														72,
														0,
														0,
														0,
														72,
														0,
														0,
														0,
														0,
														0,
														0,
														0,
														1,
														19,
														0,
														0,
														0,
														0,
														0,
														0,
														0,
														0,
														0,
														0,
														0,
														0,
														0,
														0,
														0,
														0,
														0,
														0,
														0,
														0,
														0,
														0,
														0,
														0,
														0,
														0,
														0,
														0,
														0,
														0,
														0,
														0,
														24,
														17,
														17,
													]),
													a(
														t.avcC,
														new Uint8Array(
															[1, e.profileIdc, e.profileCompatibility, e.levelIdc, 255].concat([o.length]).concat(l).concat([i.length]).concat(u)
														)
													)
												)
											: 2 == r
												? a(
														t.hev1,
														new Uint8Array([
															0,
															0,
															0,
															0,
															0,
															0,
															0,
															1,
															0,
															0,
															0,
															0,
															0,
															0,
															0,
															0,
															0,
															0,
															0,
															0,
															0,
															0,
															0,
															0,
															(65280 & e.width) >> 8,
															255 & e.width,
															(65280 & e.height) >> 8,
															255 & e.height,
															0,
															72,
															0,
															0,
															0,
															72,
															0,
															0,
															0,
															0,
															0,
															0,
															0,
															1,
															19,
															0,
															0,
															0,
															0,
															0,
															0,
															0,
															0,
															0,
															0,
															0,
															0,
															0,
															0,
															0,
															0,
															0,
															0,
															0,
															0,
															0,
															0,
															0,
															0,
															0,
															0,
															0,
															0,
															0,
															0,
															0,
															0,
															24,
															17,
															17,
														]),
														a(
															t.hvcC,
															new Uint8Array(
																[
																	1,
																	e.general_profile_flag,
																	(4278190080 & e.general_profile_compatibility_flags) >>> 24,
																	(16711680 & e.general_profile_compatibility_flags) >>> 16,
																	(65280 & e.general_profile_compatibility_flags) >>> 8,
																	255 & e.general_profile_compatibility_flags,
																	(0xff0000000000 & e.general_constraint_indicator_flags) >>> 40,
																	(0xff00000000 & e.general_constraint_indicator_flags) >>> 32,
																	(4278190080 & e.general_constraint_indicator_flags) >>> 24,
																	(16711680 & e.general_constraint_indicator_flags) >>> 16,
																	(65280 & e.general_constraint_indicator_flags) >>> 8,
																	255 & e.general_constraint_indicator_flags,
																	e.general_level_idc,
																	240,
																	0,
																	252,
																	252 | e.chroma_format_idc,
																	248 | e.bitDepthLumaMinus8,
																	248 | e.bitDepthChromaMinus8,
																	0,
																	0,
																	e.rate_layers_nested_length,
																	3,
																]
																	.concat([32, 0, 1])
																	.concat(s)
																	.concat([33, 0, 1])
																	.concat(l)
																	.concat([34, 0, 1])
																	.concat(u)
															)
														)
													)
												: void 0;
									})(e)
								);
					},
					l = function (e) {
						var r = null;
						return (
							(r = 'audio' === e.type ? a(t.smhd, n.SMHD) : a(t.vmhd, n.VMHD)),
							a(
								t.minf,
								r,
								a(t.dinf, a(t.dref, n.DREF)),
								(function (e) {
									return a(t.stbl, s(e), a(t.stts, n.STTS), a(t.stsc, n.STSC), a(t.stsz, n.STSZ), a(t.stco, n.STCO));
								})(e)
							)
						);
					},
					u = function (e) {
						return a(
							t.mdia,
							(function (e) {
								var n = e.timescale,
									r = e.duration;
								return a(
									t.mdhd,
									new Uint8Array([
										0,
										0,
										0,
										0,
										0,
										0,
										0,
										0,
										0,
										0,
										0,
										0,
										(n >>> 24) & 255,
										(n >>> 16) & 255,
										(n >>> 8) & 255,
										255 & n,
										(r >>> 24) & 255,
										(r >>> 16) & 255,
										(r >>> 8) & 255,
										255 & r,
										85,
										196,
										0,
										0,
									])
								);
							})(e),
							(function (e) {
								var r = null;
								return (r = 'audio' === e.type ? n.HDLR_AUDIO : n.HDLR_VIDEO), a(t.hdlr, r);
							})(e),
							l(e)
						);
					},
					c = function (e) {
						return a(
							t.trak,
							(function (e) {
								var n = e.id,
									r = e.duration,
									o = e.width,
									i = e.height;
								return a(
									t.tkhd,
									new Uint8Array([
										0,
										0,
										0,
										7,
										0,
										0,
										0,
										0,
										0,
										0,
										0,
										0,
										(n >>> 24) & 255,
										(n >>> 16) & 255,
										(n >>> 8) & 255,
										255 & n,
										0,
										0,
										0,
										0,
										(r >>> 24) & 255,
										(r >>> 16) & 255,
										(r >>> 8) & 255,
										255 & r,
										0,
										0,
										0,
										0,
										0,
										0,
										0,
										0,
										0,
										0,
										0,
										0,
										0,
										0,
										0,
										0,
										0,
										1,
										0,
										0,
										0,
										0,
										0,
										0,
										0,
										0,
										0,
										0,
										0,
										0,
										0,
										0,
										0,
										1,
										0,
										0,
										0,
										0,
										0,
										0,
										0,
										0,
										0,
										0,
										0,
										0,
										0,
										0,
										64,
										0,
										0,
										0,
										(o >>> 8) & 255,
										255 & o,
										0,
										0,
										(i >>> 8) & 255,
										255 & i,
										0,
										0,
									])
								);
							})(e),
							u(e)
						);
					},
					f = function (e) {
						return a(
							t.mvex,
							(function (e) {
								var n = e.id,
									r = new Uint8Array([
										0,
										0,
										0,
										0,
										(n >>> 24) & 255,
										(n >>> 16) & 255,
										(n >>> 8) & 255,
										255 & n,
										0,
										0,
										0,
										1,
										0,
										0,
										0,
										0,
										0,
										0,
										0,
										0,
										0,
										1,
										0,
										1,
									]);
								return a(t.trex, r);
							})(e)
						);
					},
					p = function (e) {
						var n,
							r,
							o =
								((n = e.timescale),
								(r = e.duration),
								a(
									t.mvhd,
									new Uint8Array([
										0,
										0,
										0,
										0,
										0,
										0,
										0,
										0,
										0,
										0,
										0,
										0,
										(n >>> 24) & 255,
										(n >>> 16) & 255,
										(n >>> 8) & 255,
										255 & n,
										(r >>> 24) & 255,
										(r >>> 16) & 255,
										(r >>> 8) & 255,
										255 & r,
										0,
										1,
										0,
										0,
										1,
										0,
										0,
										0,
										0,
										0,
										0,
										0,
										0,
										0,
										0,
										0,
										0,
										1,
										0,
										0,
										0,
										0,
										0,
										0,
										0,
										0,
										0,
										0,
										0,
										0,
										0,
										0,
										0,
										1,
										0,
										0,
										0,
										0,
										0,
										0,
										0,
										0,
										0,
										0,
										0,
										0,
										0,
										0,
										64,
										0,
										0,
										0,
										0,
										0,
										0,
										0,
										0,
										0,
										0,
										0,
										0,
										0,
										0,
										0,
										0,
										0,
										0,
										0,
										0,
										0,
										0,
										0,
										0,
										0,
										0,
										0,
										255,
										255,
										255,
										255,
									])
								)),
							i = c(e),
							s = f(e);
						return a(t.moov, o, i, s);
					},
					d = function (e, n) {
						return 'audio' === e.type
							? audioTrun(e, n)
							: (function (e, n) {
									var r,
										o = null,
										i = null,
										s = 0,
										l = n;
									if (null === (r = e.samples || [])[0].frameDuration)
										for (l += 24 + 4 * r.length, o = trunHeader(r, l), s = 0; s < r.length; s++)
											(i = r[s]), (o = o.concat([(4278190080 & i.size) >>> 24, (16711680 & i.size) >>> 16, (65280 & i.size) >>> 8, 255 & i.size]));
									else
										for (
											o = (function (e, t) {
												return [
													0,
													0,
													3,
													5,
													(4278190080 & e.length) >>> 24,
													(16711680 & e.length) >>> 16,
													(65280 & e.length) >>> 8,
													255 & e.length,
													(4278190080 & t) >>> 24,
													(16711680 & t) >>> 16,
													(65280 & t) >>> 8,
													255 & t,
													0,
													0,
													0,
													0,
												];
											})(r, (l += 24 + 4 * r.length + 4 * r.length)),
												s = 0;
											s < r.length;
											s++
										)
											(i = r[s]),
												(o = o.concat([
													(4278190080 & i.frameDuration) >>> 24,
													(16711680 & i.frameDuration) >>> 16,
													(65280 & i.frameDuration) >>> 8,
													255 & i.frameDuration,
													(4278190080 & i.size) >>> 24,
													(16711680 & i.size) >>> 16,
													(65280 & i.size) >>> 8,
													255 & i.size,
												]));
									return a(t.trun, new Uint8Array(o));
								})(e, n);
					},
					m = function (e, n) {
						return a(
							t.moof,
							(function (e) {
								var n = new Uint8Array([0, 0, 0, 0, (e >>> 24) & 255, (e >>> 16) & 255, (e >>> 8) & 255, 255 & e]);
								return a(t.mfhd, n);
							})(e),
							(function (e) {
								var n, r, o;
								return (
									(n = a(t.tfhd, new Uint8Array([0, 2, 0, 0, 0, 0, 0, 1]))),
									(r = a(
										t.tfdt,
										new Uint8Array([
											0,
											0,
											0,
											0,
											(e.baseMediaDecodeTime >>> 24) & 255,
											(e.baseMediaDecodeTime >>> 16) & 255,
											(e.baseMediaDecodeTime >>> 8) & 255,
											255 & e.baseMediaDecodeTime,
										])
									)),
									(o = d(e, 72)),
									a(t.traf, n, r, o)
								);
							})(n)
						);
					};
				return (
					(o.prototype = {
						initSegment: function (e) {
							var r = a(t.ftyp, n.FTYP),
								o = p(e),
								i = new Uint8Array(r.byteLength + o.byteLength);
							return i.set(r, 0), i.set(o, r.byteLength), i;
						},
						mediaSegment: function (e, n, r, o) {
							var i = m(e, n),
								s = (function (e) {
									return a(t.mdat, e);
								})(r),
								l = null;
							return (l = new Uint8Array(i.byteLength + s.byteLength)).set(i), l.set(s, i.byteLength), l;
						},
					}),
					new o()
				);
			};
		function M(e) {
			var t = 7,
				n = 7,
				r = 2,
				o = 3,
				a = 4,
				i = 5,
				s = 8,
				l = 16,
				u = 32,
				c = 255,
				f = 0,
				p = null,
				d = e;
			function m() {
				(f = 0), (p = new O());
			}
			function g(e, r) {
				var a = r,
					i = (f + a) >> o;
				return (a = (f + r) & t), (e[i] >> (n - (a & n))) & 1;
			}
			function S(e, t) {
				var n = f >> o,
					r = 8 * (n + 1) - f;
				if (r < 8)
					for (var a = 0; a < 3; a++) {
						var i = e[n + a];
						(i = 0 == a ? (i >> r) << r : 2 == a ? (i & (255 >> (8 - r))) | (1 << r) : 0), e.set([i], n + a);
					}
				else e.set([0], n), e.set([1], n + 1);
			}
			function h(e, t) {
				if (t <= 25) var n = _(e, t);
				else n = (_(e, 16) << (t - 16)) | _(e, t - 16);
				return n;
			}
			function _(e, t) {
				var n = 0;
				if (1 === t) n = g(e, 0);
				else for (var r = 0; r < t; r++) n = (n << 1) + g(e, r);
				return (f += t), n;
			}
			function v(e, t) {
				for (var n = 0, o = 0, a = t; f + a < 8 * e.length && !g(e, a++); ) n++;
				if (0 === n) return (f += 1), 0;
				o = 1 << n;
				for (var i = n - 1; i >= 0; i--, a++) o |= g(e, a) << i;
				return (f += n * r + 1), o - 1;
			}
			function y(e, t) {
				var n = v(e, t);
				return 1 & n ? (n + 1) / r : -n / r;
			}
			function T(e) {
				p.put('cpb_cnt_minus1', v(e, 0)), p.put('bit_rate_scale', _(e, a)), p.put('cpb_size_scale', _(e, a));
				for (var t = p.get('cpb_cnt_minus1'), n = new Array(t), r = new Array(t), o = new Array(t), s = 0; s <= t; s++)
					(n[s] = v(e, 0)), (r[s] = v(e, 0)), (o[s] = _(e, 1));
				p.put('bit_rate_value_minus1', n),
					p.put('cpb_size_value_minus1', r),
					p.put('cbr_flag', o),
					p.put('initial_cpb_removal_delay_length_minus1', _(e, i)),
					p.put('cpb_removal_delay_length_minus1', _(e, i)),
					p.put('dpb_output_delay_length_minus1', _(e, i)),
					p.put('time_offset_length', _(e, i));
			}
			return (
				(m.prototype = {
					parse: function (e) {
						if (((f = 0), p.clear(), 1 == d)) {
							p.put('forbidden_zero_bit', _(e, 1)),
								p.put('nal_ref_idc', _(e, r)),
								p.put('nal_unit_type', _(e, i)),
								p.put('profile_idc', _(e, s)),
								p.put('profile_compatibility', _(e, s)),
								p.put('level_idc', _(e, s)),
								p.put('seq_parameter_set_id', v(e, 0));
							var t = p.get('profile_idc');
							if (
								(100 === t ||
									110 === t ||
									122 === t ||
									244 === t ||
									44 === t ||
									83 === t ||
									86 === t ||
									118 === t ||
									128 === t ||
									138 === t ||
									139 === t ||
									134 === t) &&
								(p.put('chroma_format_idc', v(e, 0)),
								p.get('chroma_format_idc') === o && p.put('separate_colour_plane_flag', _(e, 1)),
								p.put('bit_depth_luma_minus8', v(e, 0)),
								p.put('bit_depth_chroma_minus8', v(e, 0)),
								p.put('qpprime_y_zero_transform_bypass_flag', _(e, 1)),
								p.put('seq_scaling_matrix_present_flag', _(e, 1)),
								p.get('seq_scaling_matrix_present_flag'))
							) {
								for (var n = p.get('chroma_format_idc') !== o ? s : 12, a = new Array(n), m = 0; m < n; m++)
									if (((a[m] = _(e, 1)), a[m]))
										for (var g = m < 6 ? l : 64, A = 8, b = 8, P = 0; P < g; P++) b && (b = (A + y(e, 0) + 256) % 256), (A = 0 === b ? A : b);
								p.put('seq_scaling_list_present_flag', a);
							}
							if ((p.put('log2_max_frame_num_minus4', v(e, 0)), p.put('pic_order_cnt_type', v(e, 0)), 0 === p.get('pic_order_cnt_type')))
								p.put('log2_max_pic_order_cnt_lsb_minus4', v(e, 0));
							else if (1 === p.get('pic_order_cnt_type')) {
								p.put('delta_pic_order_always_zero_flag', _(e, 1)),
									p.put('offset_for_non_ref_pic', y(e, 0)),
									p.put('offset_for_top_to_bottom_field', y(e, 0)),
									p.put('num_ref_frames_in_pic_order_cnt_cycle', v(e, 0));
								for (var C = 0; C < p.get('num_ref_frames_in_pic_order_cnt_cycle'); C++) p.put('num_ref_frames_in_pic_order_cnt_cycle', y(e, 0));
							}
							p.put('num_ref_frames', v(e, 0)),
								p.put('gaps_in_frame_num_value_allowed_flag', _(e, 1)),
								p.put('pic_width_in_mbs_minus1', v(e, 0)),
								p.put('pic_height_in_map_units_minus1', v(e, 0)),
								p.put('frame_mbs_only_flag', _(e, 1)),
								0 === p.get('frame_mbs_only_flag') && p.put('mb_adaptive_frame_field_flag', _(e, 1)),
								p.put('direct_8x8_interence_flag', _(e, 1)),
								p.put('frame_cropping_flag', _(e, 1)),
								1 === p.get('frame_cropping_flag') &&
									(p.put('frame_cropping_rect_left_offset', v(e, 0)),
									p.put('frame_cropping_rect_right_offset', v(e, 0)),
									p.put('frame_cropping_rect_top_offset', v(e, 0)),
									p.put('frame_cropping_rect_bottom_offset', v(e, 0))),
								p.put('vui_parameters_present_flag', _(e, 1)),
								p.get('vui_parameters_present_flag') &&
									(function (e) {
										p.put('aspect_ratio_info_present_flag', _(e, 1)),
											p.get('aspect_ratio_info_present_flag') &&
												(p.put('aspect_ratio_idc', _(e, s)),
												p.get('aspect_ratio_idc') === c && (S(e), p.put('sar_width', _(e, l)), S(e), p.put('sar_height', _(e, l)))),
											p.put('overscan_info_present_flag', _(e, 1)),
											p.get('overscan_info_present_flag') && p.put('overscan_appropriate_flag', _(e, 1)),
											p.put('video_signal_type_present_flag', _(e, 1)),
											p.get('video_signal_type_present_flag') &&
												(p.put('video_format', _(e, o)),
												p.put('video_full_range_flag', _(e, 1)),
												p.put('colour_description_present_flag', _(e, 1)),
												p.get('colour_description_present_flag') &&
													(p.put('colour_primaries', _(e, s)), p.put('transfer_characteristics', _(e, s)), p.put('matrix_coefficients', _(e, s)))),
											p.put('chroma_loc_info_present_flag', _(e, 1)),
											p.get('chroma_loc_info_present_flag') &&
												(p.put('chroma_sample_loc_type_top_field', v(e, 0)), p.put('chroma_sample_loc_type_bottom_field', v(e, 0))),
											p.put('timing_info_present_flag', _(e, 1)),
											p.get('timing_info_present_flag') &&
												(p.put('num_units_in_tick', _(e, u)), p.put('time_scale', _(e, u)), p.put('fixed_frame_rate_flag', _(e, 1))),
											p.put('nal_hrd_parameters_present_flag', _(e, 1)),
											p.get('nal_hrd_parameters_present_flag') && T(e),
											p.put('vcl_hrd_parameters_present_flag', _(e, 1)),
											p.get('vcl_hrd_parameters_present_flag') && T(e),
											(p.get('nal_hrd_parameters_present_flag') || p.get('vcl_hrd_parameters_present_flag')) && p.put('low_delay_hrd_flag', _(e, 1)),
											p.put('pic_struct_present_flag', _(e, 1)),
											p.put('bitstream_restriction_flag', _(e, 1)),
											p.get('bitstream_restriction_flag') &&
												(p.put('motion_vectors_over_pic_boundaries_flag', _(e, 1)),
												p.put('max_bytes_per_pic_denom', v(e, 0)),
												p.put('max_bits_per_mb_denom', v(e, 0)));
									})(e);
						} else if (2 == d) {
							var E = new ArrayBuffer(256),
								I = new Uint8Array(E);
							!(function (e, t, n, r) {
								for (var o = 0, a = 0; o + 2 < t && a + 2 < r; ++o)
									0 == e[o] && 0 == e[o + 1] && 3 == e[o + 2] ? ((n[a++] = e[o++]), (n[a++] = e[o++])) : (n[a++] = e[o]);
								for (; o < t && a < r; ) n[a++] = e[o++];
							})(e, e.length, I, 256);
							var w = [],
								R = [];
							_(I, 4);
							var M = _(I, 3);
							for (
								p.put('temporalIdNested', _(I, 1)),
									p.put('general_profile_space', _(I, 2)),
									p.put('general_tier_flag', _(I, 1)),
									p.put('general_profile_idc', _(I, 5)),
									p.put('general_profile_compatibility_flags', h(I, 32)),
									p.put('general_constraint_indicator_flags', ((D = I), (O = 48) <= 32 ? h(D, O) : (h(D, O - 32) << 32) | h(D, 32))),
									p.put('general_level_idc', _(I, 8)),
									m = 0;
								m < M && m < 6;
								m++
							)
								(w[m] = _(I, 1)), (R[m] = _(I, 1));
							if (M > 0) for (m = M; m < 8; m++) _(I, 2);
							for (m = 0; m < M && m < 6; m++) R[m] && _(I, 8);
							v(I, 0);
							p.put('chroma_format_idc', v(I, 0));
							v(I, 0), v(I, 0);
							_(I, 1),
								v(I, 0),
								v(I, 0),
								v(I, 0),
								v(I, 0),
								p.put('bitDepthLumaMinus8', v(I, 0) + 8),
								p.put('bitDepthChromaMinus8', v(I, 0) + 8),
								(E = null),
								(I = null);
						}
						var D, O;
						return !0;
					},
					getSizeInfo: function () {
						var e = 0,
							t = 0;
						0 === p.get('chroma_format_idc')
							? (e = t = 0)
							: 1 === p.get('chroma_format_idc')
								? (e = t = r)
								: p.get('chroma_format_idc') === r
									? ((e = r), (t = 1))
									: p.get('chroma_format_idc') === o &&
										(0 === p.get('separate_colour_plane_flag') ? (e = t = 1) : 1 === p.get('separate_colour_plane_flag') && (e = t = 0));
						var n = p.get('pic_width_in_mbs_minus1') + 1,
							a = p.get('pic_height_in_map_units_minus1') + 1,
							i = (r - p.get('frame_mbs_only_flag')) * a,
							s = 0,
							u = 0,
							c = 0,
							f = 0;
						1 === p.get('frame_cropping_flag') &&
							((s = p.get('frame_cropping_rect_left_offset')),
							(u = p.get('frame_cropping_rect_right_offset')),
							(c = p.get('frame_cropping_rect_top_offset')),
							(f = p.get('frame_cropping_rect_bottom_offset')));
						var d = n * l * (i * l);
						return { width: n * l - e * (s + u), height: i * l - t * (r - p.get('frame_mbs_only_flag')) * (c + f), decodeSize: d };
					},
					getSpsValue: function (e) {
						return p.get(e);
					},
					getCodecInfo: function () {
						return (
							p.get('profile_idc').toString(l) +
							(p.get('profile_compatibility') < 15 ? '0' + p.get('profile_compatibility').toString(l) : p.get('profile_compatibility').toString(l)) +
							p.get('level_idc').toString(l)
						);
					},
				}),
				new m()
			);
		}
		var D,
			O = function () {
				this.map = {};
			};
		O.prototype = {
			put: function (e, t) {
				this.map[e] = t;
			},
			get: function (e) {
				return this.map[e];
			},
			containsKey: function (e) {
				return e in this.map;
			},
			containsValue: function (e) {
				for (var t in this.map) if (this.map[t] === e) return !0;
				return !1;
			},
			isEmpty: function (e) {
				return 0 === this.size();
			},
			clear: function () {
				for (var e in this.map) delete this.map[e];
			},
			remove: function (e) {
				delete this.map[e];
			},
			keys: function () {
				var e = new Array();
				for (var t in this.map) e.push(t);
				return e;
			},
			values: function () {
				var e = new Array();
				for (var t in this.map) e.push(this.map[t]);
				return e;
			},
			size: function () {
				var e = 0;
				for (var t in this.map) e++;
				return e;
			},
		};
		var U = 10,
			k = 0;
		function F(e) {
			return D._RENDER_Destroy(e);
		}
		var L;
		var N = 1,
			H = 0,
			B = {
				IVSINFOTYPE_PRESETPOS: 1,
				IVSINFOTYPE_MOTINTRKS: 2,
				IVSINFOTYPE_MOTINTRKS_EX: 3,
				IVSINFOTYPE_LIGHT: 4,
				IVSINFOTYPE_RAWDATA: 5,
				IVSINFOTYPE_TRACK: 6,
				IVSINFOTYPE_TRACK_EX_B0: 7,
				IVSINFOTYPE_MOTIONFRAME: 9,
				IVSINFOTYPE_VIDEO_CONCENTRATION: 10,
				IVSINFOTYPE_OVERLAY_PIC: 11,
				IVSINFOTYPE_OSD_INFO: 12,
				IVSINFOTYPE_GPS_INFO: 13,
				IVSINFOTYPE_TAGGING_INFO: 14,
				IVSINFOTYPE_TRACK_A1: 15,
				IVSINFOTYPE_DATA_WITH_LARGE_AMOUNT: 16,
				IVSINFOTYPE_TRACK_A1_EX: 17,
				IVSINFOTYPE_DATA_WITH_WATER_LEVEL_MONITOR: 18,
				IVSINFOTYPE_INTELFLOW: 19,
				IVSINFOTYPE_DATA_WITH_SOUND_DECIBEL: 20,
				IVSINFOTYPE_DATA_WITH_SMART_MOTION: 21,
				IVSINFOTYPE_DHOP_SMART: 22,
				IVSINFOTYPE_TRAFFIC_LIGHT: 23,
				IVSINFOTYPE_PTZ_LOCATION: 24,
			},
			G = {
				DRAW_JSON: 0,
				DRAW_TRACK: 1,
				DRAW_ALARM: 2,
				DRAW_RULE: 3,
				DRAW_MOVE_CHECK: 7,
				DRAW_TEST: 9,
				DRAW_WEB_RULE: 11,
				DRAW_WEB_ALARM: 12,
				DRAW_FLOW_INFO: 13,
				DRAW_TRACKEX2: 14,
				DRAW_WUXI235_TRACKEX2: 15,
				DRAW_TRACKEXA1: 16,
				DRAW_TRACKEX2_TYPE_HUMAN: 17,
				DRAW_TRACKEX2_TYPE_VEHICLE: 18,
				DRAW_TRACKEX2_TYPE_NONMOTOR: 19,
				DRAW_TRACKEX2_TYPE_SHOPPRESENCE: 20,
				DRAW_TRACKEX2_TYPE_FLOWBUSINESS: 21,
				DRAW_INTELFLOW: 22,
				DRAW_SMARTMOTION: 23,
				DRAW_DHOPSMART: 24,
				DRAW_DATA_WITH_LARGE_AMOUNT: 25,
				DRAW_TRACKEX2_TYPE_BAG: 26,
				DRAW_RULE_HIGHWAY_LANES: 27,
				DRAW_WATER_LEVEL_MONITOR: 28,
				DRAW_END: 29,
			};
		function V(e, t) {
			L._DRAW_DrawByRenderHandle(e, 0, t);
		}
		var W = function (e, t, n, r) {
			var o = n,
				a = e,
				i = r,
				s = null,
				l = 0,
				u = 0,
				c = !1,
				f = null,
				p = 0,
				d = 0,
				m = !1,
				g = !1,
				S = 1,
				h = !1,
				_ = 0,
				v = 0,
				y = 0,
				T = function (e) {
					(function (e) {
						(this.buffer = e), (this.previous = null), (this.next = null);
					}).call(this, e);
				};
			function A() {
				var e = o || 25;
				function t() {
					(this.first = null), (this.size = 0);
				}
				return (
					(t.prototype = {
						enqueue: function (t) {
							this.size >= e && this.clear();
							var n = new T(t);
							if (null === this.first) this.first = n;
							else {
								for (var r = this.first; null !== r.next; ) r = r.next;
								r.next = n;
							}
							return (this.size += 1), n;
						},
						dequeue: function () {
							var e = null;
							return null !== this.first && ((e = this.first), (this.first = this.first.next), (this.size -= 1)), e;
						},
						clear: function () {
							for (var e = null; null !== this.first; )
								(e = this.first), (this.first = this.first.next), (this.size -= 1), (e.buffer = null), (e = null);
							(this.size = 0), (this.first = null);
						},
					}),
					new t()
				);
			}
			function b() {
				(f = new A()), (c = !1);
			}
			var P = function (e) {
					if (null !== s) {
						var t = {
							ImageFormat: k,
							DataY: e.buffer.dataY,
							DataU: e.buffer.dataU,
							DataV: e.buffer.dataV,
							width0: _,
							width1: _ / 2,
							width2: _ / 2,
							height0: v,
							height1: v / 2,
							height2: v / 2,
						};
						return (
							(function (e, t, n, r) {
								var o = D._malloc(80),
									a = t.width0 * t.height0,
									i = D._malloc(a);
								D.writeArrayToMemory(t.DataY, i);
								var s = t.width1 * t.height1,
									l = D._malloc(s);
								D.writeArrayToMemory(t.DataU, l);
								var u = t.width2 * t.height2,
									c = D._malloc(u);
								D.writeArrayToMemory(t.DataV, c),
									(D.HEAP32[o / 4 + 0] = 0),
									(D.HEAP32[o / 4 + 1] = t.ImageFormat),
									(D.HEAP32[o / 4 + 2] = 0),
									(D.HEAP32[o / 4 + 3] = 0),
									(D.HEAP32[o / 4 + 4] = i),
									(D.HEAP32[o / 4 + 5] = l),
									(D.HEAP32[o / 4 + 6] = c),
									(D.HEAP32[o / 4 + 7] = t.width0),
									(D.HEAP32[o / 4 + 8] = t.width1),
									(D.HEAP32[o / 4 + 9] = t.width2),
									(D.HEAP32[o / 4 + 10] = t.height0),
									(D.HEAP32[o / 4 + 11] = t.height1),
									(D.HEAP32[o / 4 + 12] = t.height2),
									(D.HEAP32[o / 4 + 13] = t.width0),
									(D.HEAP32[o / 4 + 14] = t.width1),
									(D.HEAP32[o / 4 + 15] = t.width2),
									(D.HEAP32[o / 4 + 16] = t.height0),
									(D.HEAP32[o / 4 + 17] = t.height1),
									(D.HEAP32[o / 4 + 18] = t.height2),
									(D.HEAP32[o / 4 + 19] = 0);
								var f = 0,
									p = 0;
								0 !== n &&
									((f = D._malloc(16)),
									(D.HEAP32[f / 4 + 0] = n.left),
									(D.HEAP32[f / 4 + 1] = n.top),
									(D.HEAP32[f / 4 + 2] = n.right),
									(D.HEAP32[f / 4 + 3] = n.bottom)),
									0 !== r &&
										((p = D._malloc(16)),
										(D.HEAP32[p / 4 + 0] = r.left),
										(D.HEAP32[p / 4 + 1] = r.top),
										(D.HEAP32[p / 4 + 2] = r.right),
										(D.HEAP32[p / 4 + 3] = r.bottom)),
									D._RENDER_DrawImage(e, o, f, p),
									D._free(i),
									D._free(l),
									D._free(c),
									D._free(o),
									0 !== f && D._free(f),
									0 !== p && D._free(p);
							})(s, t, 0, 0),
							h && V(y, e.buffer.nFrameID),
							delete e.buffer,
							(e.buffer = null),
							(e.previous = null),
							(e.next = null),
							(e = null),
							!0
						);
					}
					return !1;
				},
				C = function e(t) {
					if (!0 === c) {
						if (0 === l || t - l < 200)
							return (
								0 === l && (l = t),
								void (
									null !== f &&
									(m || (null !== (n = f.dequeue()) && null !== n.buffer && null !== n.buffer.dataY && ((m = !0), P(n))),
									window.requestAnimationFrame(e))
								)
							);
						if (i) return null !== (n = f.dequeue()) && null !== n.buffer && null !== n.buffer.dataY && P(n), void window.requestAnimationFrame(e);
						0 === u && (u = t);
						var n,
							r = t - u;
						r > d &&
							null !== (n = f.dequeue()) &&
							null !== n.buffer &&
							null !== n.buffer.dataY &&
							(g && (p = r - d), (d = n.buffer.nCostTime), (d -= p), P(n), (u = t), (g = !0)),
							window.requestAnimationFrame(e);
					}
				};
			return (
				(b.prototype = {
					draw: function (e, t, n, r, o) {
						if (!0 === c && null !== f)
							if (document.hidden && f.size >= 25) f.clear();
							else {
								var a = {};
								(a.dataY = e), (a.dataU = t), (a.dataV = n), (a.nFrameID = r), 0 == o && (o = 25);
								var s = 1e3 / o,
									l = f.size * s;
								i || (S = l > 500 ? 1.2 : l < 200 ? 0.8 : 1), (a.nCostTime = 1e3 / o / S), a.nCostTime < 20 && (a.nCostTime = 20), f.enqueue(a);
							}
					},
					resize: function (e, t) {
						this.stopRendering(),
							null !== f && f.clear(),
							null !== s && (F(s), (s = null)),
							(s = (function (e) {
								var t = (D = window.REModule)._malloc(12),
									n = D.allocateUTF8(e);
								(D.HEAP32[t / 4 + 0] = U), (D.HEAP32[t / 4 + 1] = n), (D.HEAP32[t / 4 + 2] = 0);
								var r = D._RENDER_Create(t);
								return D._free(n), D._free(t), r;
							})(a.id)),
							this.startRendering(),
							(_ = e),
							(v = t);
					},
					initStartTime: function () {
						0 === l && this.startRendering();
					},
					startRendering: function () {
						0 === l && ((c = !0), window.requestAnimationFrame(C));
					},
					pause: function () {
						c = !1;
					},
					play: function () {
						c = !0;
					},
					stopRendering: function () {
						(c = !1), (l = 0);
					},
					setPlaySpeed: function (e) {
						S = e;
					},
					terminate: function () {
						(c = !1), (l = 0), null !== f && (f.clear(), (f = null)), s && F(s), (s = null);
					},
					getVideoBufferQueueSize: function () {
						return f.size;
					},
					OpenIVS: function (e, t) {
						(function (e) {
							(L = window.IVSModule)._DRAW_Open(e);
						})((y = e)),
							(function (e, t) {
								var n = L.allocateUTF8(t);
								L._DRAW_SetWebCanvas(e, n), L._free(n);
							})(y, t),
							(h = !0);
					},
					CloseIVS: function () {
						var e;
						(h = !1),
							(e = y),
							L._DRAW_Clean(e),
							(function (e) {
								L._DRAW_Close(e);
							})(y);
					},
					SetIvsEnable: function (e, t) {
						!(function (e, t, n) {
							L._DRAW_SetEnable(e, t, n);
						})(y, e, t);
					},
					CleanScreen: function (e, t, n, r) {
						null != s &&
							(f.clear(),
							(function (e, t, n, r, o) {
								var a = D._malloc(16);
								(D.HEAP32[a / 4 + 0] = t), (D.HEAP32[a / 4 + 1] = n), (D.HEAP32[a / 4 + 2] = r), (D.HEAP32[a / 4 + 3] = o);
								D._RENDER_ClearScreen(e, a);
								D._free(a);
							})(s, e, t, n, r));
					},
					DrawIVS: function (e, t, n, r) {
						if (h) {
							var o = (function (e) {
									var t = 0,
										n = H;
									switch (e) {
										case B.IVSINFOTYPE_DATA_WITH_LARGE_AMOUNT:
											(t = G.DRAW_DATA_WITH_LARGE_AMOUNT), (n = N);
											break;
										case B.IVSINFOTYPE_DATA_WITH_WATER_LEVEL_MONITOR:
											(t = G.DRAW_WATER_LEVEL_MONITOR), (n = N);
									}
									return { bDeal: n, nIvsDrawType: t };
								})(t),
								a = o.bDeal,
								i = o.nIvsDrawType;
							if (a)
								!(function (e, t, n, r, o) {
									L._DRAW_InputIVSData(e, t, n, r, o);
								})(y, i, e, n, r);
							else
								switch (t) {
									case B.IVSINFOTYPE_RAWDATA:
										!(function (e, t, n, r) {
											var o = L._malloc(n);
											L.writeArrayToMemory(t, o);
											L._DRAW_InputJsonData(e, o, n, r);
											L._free(o);
										})(y, e, n, r);
										break;
									case B.IVSINFOTYPE_TRACK:
										!(function (e, t, n, r, o) {
											L._DRAW_InputTrackData(e, t, n, r, o);
										})(y, 0, e, n, r);
										break;
									case B.IVSINFOTYPE_TRACK_EX_B0:
									case B.IVSINFOTYPE_INTELFLOW:
									case B.IVSINFOTYPE_DATA_WITH_SMART_MOTION:
									case B.IVSINFOTYPE_DHOP_SMART:
										!(function (e, t, n, r, o) {
											L._DRAW_InputTrackDataEx2(e, t, n, r, o);
										})(y, t, e, n, r);
								}
						}
					},
					DrawDrawIVS: function (e) {
						h && V(y, e);
					},
				}),
				new b()
			);
		};
		var x = function () {
			var e = 200,
				t = null,
				n = null,
				r = null,
				o = 0,
				a = 0,
				i = !1,
				s = 0,
				l = 0,
				u = null,
				c = !1,
				f = new Float32Array(8e4),
				p = 0,
				d = null,
				m = 0,
				g = !1;
			function S(n, o) {
				if (g) {
					var i = o - s;
					if (
						((i > e || i < 0) && ((a = 0), (p = 0), (c = !0), null !== d && d.stop()),
						a - t.currentTime < 0 && (a = 0),
						(s = o),
						(f = (function (e, t, n) {
							var r = e;
							return n + t.length >= r.length && (r = new Float32Array(r.length + 8e4)).set(r, 0), r.set(t, n), r;
						})(f, n, p)),
						(p += n.length),
						!c)
					) {
						var l = 0;
						if (p / n.length > 1 && (null !== u && (l = u * m), l >= p || null === u)) return void (p = 0);
						var S = null;
						(S = t.createBuffer(1, p - l, m)).getChannelData(0).set(f.subarray(l, p)),
							(p = 0),
							(d = null),
							((d = t.createBufferSource()).buffer = S),
							d.connect(r),
							a || (a = t.currentTime + 0.1),
							d.start(a),
							(a += S.duration);
					}
				}
			}
			function h() {}
			return (
				(h.prototype = {
					audioInit: function (e) {
						if (((a = 0), null !== t));
						else
							try {
								return (
									(window.AudioContext =
										window.AudioContext || window.webkitAudioContext || window.mozAudioContext || window.oAudioContext || window.msAudioContext),
									((t = new AudioContext()).onstatechange = function () {
										'running' === t.state && (i = !0);
									}),
									(n = t.createGain()),
									(r = t.createBiquadFilter()).connect(n),
									(r.type = 'lowpass'),
									(r.frequency.value = 1500),
									(r.gain.value = 40),
									n.connect(t.destination),
									this.setVolume(e),
									!0
								);
							} catch (e) {
								return !1;
							}
					},
					play: function () {
						this.setVolume(o);
					},
					stop: function () {
						(o = 0), (n.gain.value = 0), (a = 0), (t = null);
					},
					bufferAudio: function (e, n) {
						a - t.currentTime > 10 && (this.terminate(), this.audioInit(o)), i && S(e, 0);
					},
					setSoundState: function (e) {
						g = e;
					},
					setVolume: function (e) {
						o = e;
						var t = e / 1;
						t <= 0 ? ((n.gain.value = 0), (a = 0)) : (n.gain.value = t >= 1 ? 1 : t);
					},
					getVolume: function () {
						return o;
					},
					Mute: function (e) {
						if (e) (n.gain.value = 0), (a = 0);
						else {
							var t = o / 1;
							t <= 0 ? ((n.gain.value = 0), (a = 0)) : (n.gain.value = t >= 1 ? 1 : t);
						}
					},
					terminate: function () {
						'closed' !== t.state && ((p = 0), (a = 0), (i = !1), (d = null), (r = null), (n = null), t.close(), (t = null));
					},
					setBufferingFlag: function (e, t) {
						'init' === t ? (l = e) : c && (0 === e || 'undefined' === typeof e || null === e ? (u = null) : ((u = e - l), (l = 0)), (c = !1));
					},
					getBufferingFlag: function () {
						return c;
					},
					setInitVideoTimeStamp: function (e) {
						l = e;
					},
					getInitVideoTimeStamp: function () {
						return l;
					},
					setSamplingRate: function (e) {
						m = e;
					},
					getAudioBufTime: function () {
						if (void 0 !== t) {
							var e = a - t.currentTime;
							return e > 0 ? (e *= 1e3) : (e = 0), e;
						}
						return 0;
					},
				}),
				new h()
			);
		};
		var Y = function () {
			var e = null,
				t = '',
				n = null,
				r = null,
				o = null,
				a = null,
				l = null,
				u = null,
				c = null,
				f = 1,
				p = { timestamp: 0, timestamp_usec: 0, timezone: 0 },
				d = { timestamp: 0, timestamp_usec: 0, timezone: 0 },
				m = null,
				g = !1,
				S = null,
				h = null,
				_ = null,
				v = !1,
				y = !0,
				T = 0,
				A = !1,
				b = [],
				P = 0.5,
				C = null,
				E = null,
				I = null,
				w = 0,
				R = 0,
				M = !1,
				D = null,
				O = 'png',
				U = 1,
				k = s(),
				F = null,
				L = 0,
				N = 0,
				H = 0,
				B = 8,
				G = null,
				V = !1,
				W = !1,
				x = [],
				Y = {},
				z = 25,
				q = 0.5,
				K = !1,
				j = !1;
			function X() {}
			function Z() {
				Q(), (j = !0);
			}
			function J() {
				var e = 0;
				if (null !== S) for (e = 0; e < S.length; e++) I.removeEventListener(S[e].type, S[e].function);
				if (null !== _) for (e = 0; e < _.length; e++) E.removeEventListener(_[e].type, _[e].function);
				if (null !== h) for (e = 0; e < h.length; e++) C.removeEventListener(h[e].type, h[e].function);
			}
			function Q() {
				if (null === E || 'ended' === E.readyState)
					return (
						(function (e) {
							(_ = []).push({ type: 'sourceopen', function: Z }), _.push({ type: 'error', function: ae });
							for (var t = 0; t < _.length; t++) e.addEventListener(_[t].type, _[t].function);
						})((E = new MediaSource())),
						(C.src = window.URL.createObjectURL(E)),
						void i.log('videoMediaSource::appendInitSegment new MediaSource()')
					);
				if ((i.log('videoMediaSource::appendInitSegment start'), 0 === E.sourceBuffers.length)) {
					E.duration = 0;
					var r = null;
					if ((1 == n ? (r = 'video/mp4;codecs="avc1.' + t + '"') : 2 == n && (r = 'video/mp4; codecs="hvc1.1.6.L30.B0"'), null == r)) return;
					if (!MediaSource.isTypeSupported(r)) return i.log('not support' + r), G && G({ errorCode: 101 }), void (u && u('InitError'));
					!(function (e) {
						(S = []).push({ type: 'error', function: ie }), S.push({ type: 'updateend', function: re }), S.push({ type: 'update', function: oe });
						for (var t = 0; t < S.length; t++) e.addEventListener(S[t].type, S[t].function);
					})((I = E.addSourceBuffer(r)));
				}
				var o = e();
				null !== o ? (I.appendBuffer(o), i.log('videoMediaSource::appendInitSegment end, codecInfo = ' + t)) : E.endOfStream('network');
			}
			function $() {
				C.paused && (o(), v || V || C.play());
			}
			function ee() {
				C.paused || y || (i.log('pause'), C.pause());
			}
			function te() {
				x.length &&
					(function (e) {
						if ((!K && j && ((K = !0), Q()), null !== I && 'closed' !== E.readyState && 'ended' !== E.readyState))
							try {
								if (b.length > 0)
									return i.count('1.segmentWaitDecode.length: ' + b.length), b.push(e), void i.count('2.segmentWaitDecode.length: ' + b.length);
								I.updating ? (i.log('updating..........'), b.push(e)) : (I.appendBuffer(e), V && (Y.buffer = e));
							} catch (e) {
								i.log('videoMediaSource::appendNextMediaSegment error >> initVideo'), (b.length = 0), G && G({ errorCode: 101 });
							}
					})(x.shift());
			}
			function ne() {
				if (null !== E)
					try {
						if (I && I.buffered.length > 0) {
							if (
								((function () {
									var e = 1 * I.buffered.start(I.buffered.length - 1),
										t = 1 * I.buffered.end(I.buffered.length - 1);
									t - e > 60 && I.remove(e, t - 10);
								})(),
								(W && !V) || (C.duration > q && ((C.currentTime = (C.duration - q).toFixed(3)), (q += z < 10 ? 0.5 : 0.1))),
								C && C.duration - C.currentTime > B)
							) {
								if ((G && G({ errorCode: 101 }), I.updating)) return;
								var e = C.duration - 0.1;
								C.currentTime = e.toFixed(3);
							}
							if (A && !g) {
								var t = 1 * I.buffered.start(I.buffered.length - 1),
									n = 1 * I.buffered.end(I.buffered.length - 1);
								if ((0 === C.currentTime ? n - t : n - C.currentTime) >= P + 0.1) {
									if ((i.log('\u8df3\u79d2'), I.updating)) return;
									var r = n - 0.1;
									C.currentTime = r.toFixed(3);
								}
							}
						}
					} catch (e) {
						i.log('sourceBuffer has been removed');
					}
			}
			function re() {}
			function oe() {
				b.length > 0 &&
					(i.count('1. onSourceUpdate .segmentWaitDecode.length: ' + b.length),
					I.updating || (i.count('2. onSourceUpdate .appendBuffer: ' + b.length + '  ' + b[0].length), I.appendBuffer(b[0]), b.shift()));
			}
			function ae() {
				u && u('SourceError');
			}
			function ie() {
				u && u('SourceBufferError');
			}
			function se() {
				ee(), G && G({ errorCode: 101 }), u && u('Error');
			}
			function le() {
				(v = !0), (y = !1), (W = !0), M || ((M = !0), l('PlayStart'));
			}
			function ue() {
				(v = !1), (y = !0), i.log('\u6682\u505c\u64ad\u653e----------------------------------------------');
			}
			function ce() {
				var e = parseInt(E.duration, 10),
					t = parseInt(C.currentTime, 10),
					n = { timestamp: p.timestamp - f * (e - t + (1 !== f ? 1 : 0)), timestamp_usec: 0, timezone: p.timezone };
				0 === t ||
					isNaN(e) ||
					(!g && Math.abs(e - t) > 4 && 1 === f) ||
					C.paused ||
					(null === m
						? ((m = n), a(0, 'currentTime'))
						: ((m.timestamp <= n.timestamp && f >= 1) || (m.timestamp > n.timestamp && f < 1)) &&
							((m = n), ++T > 4 && a(n.timestamp, 'currentTime')));
			}
			function fe() {
				null != I && ($(), ne());
			}
			function pe() {
				o();
			}
			function de() {
				$();
			}
			function me() {
				if ((i.log('\u9700\u8981\u7f13\u51b2\u4e0b\u4e00\u5e27'), (A = !1), 0 == R)) (w = Date.now()), R++;
				else {
					R++;
					var e = Date.now() - w;
					i.log('diffTime: ' + e + '  Count: ' + R), R >= 5 && e < 6e4 && P <= 1 && ((P += 0.1), (R = 0), (w = 0), i.log('delay + 0.1 = ' + P));
				}
			}
			function ge() {
				i.log('Can play !');
			}
			function Se() {
				i.log('Can play without waiting'), (A = !0);
			}
			function he() {
				i.log('loadedmetadata');
			}
			function _e(e, t) {
				var n = document.createElement('canvas');
				(n.width = C.videoWidth), (n.height = C.videoHeight);
				var r = n.getContext('2d');
				r.drawImage(C, 0, 0, n.width, n.height);
				for (var o = 0; o < e.length; o++) e[o] && r.drawImage(e[o], 0, 0, n.width, n.height);
				for (
					var a = n.toDataURL(), i = atob(a.substring('data:image/jpg;base64,'.length)), s = new Uint8Array(i.length), l = 0, u = i.length;
					l < u;
					++l
				)
					s[l] = i.charCodeAt(l);
				var c = new Blob([s.buffer], { type: 'image/jpg' });
				ve(c, t), (c = null);
			}
			X.prototype = {
				init: function (e) {
					(c = s()),
						i.log('videoMediaSource::init browserType = ' + c),
						((C = e).autoplay = 'safari' !== c),
						(C.controls = !1),
						(C.preload = 'auto'),
						(function (e) {
							(h = []).push({ type: 'durationchange', function: fe }),
								h.push({ type: 'playing', function: le }),
								h.push({ type: 'error', function: se }),
								h.push({ type: 'pause', function: ue }),
								h.push({ type: 'timeupdate', function: ce }),
								h.push({ type: 'resize', function: pe }),
								h.push({ type: 'seeked', function: de }),
								h.push({ type: 'waiting', function: me }),
								h.push({ type: 'canplaythrough', function: Se }),
								h.push({ type: 'canplay', function: ge }),
								h.push({ type: 'loadedmetadata', function: he });
							for (var t = 0; t < h.length; t++) e.addEventListener(h[t].type, h[t].function);
						})(C),
						Q();
				},
				setInitSegmentFunc: function (t) {
					e = t;
				},
				getVideoElement: function () {
					return C;
				},
				setCodecInfo: function (e) {
					t = e;
				},
				setMediaSegment: function (e) {
					x.push(e), V || te();
				},
				capturePic: function (e, t) {
					D && clearInterval(D),
						A || 'edge' === k
							? _e(e, t)
							: (D = setInterval(function () {
									A && (_e(e, t), clearInterval(D));
								}, 200));
				},
				getCapture: function (e, t, n) {
					D && clearInterval(D), (U = n || 1), (O = 'png'), ('jpg' !== t && 'jpeg' !== t) || (O = 'jpeg');
					var r = document.createElement('canvas'),
						o = null;
					return (
						(r.width = C.videoWidth),
						(r.height = C.videoHeight),
						A || 'edge' === k
							? (r.getContext('2d').drawImage(C, 0, 0, r.width, r.height), (o = r.toDataURL('image/' + O, U)))
							: A && (r.getContext('2d').drawImage(C, 0, 0, r.width, r.height), (o = r.toDataURL('image/' + O, U))),
						o
					);
				},
				setInitSegment: function () {
					Q();
				},
				ResetInitSegmentFlag: function () {
					K = !1;
				},
				setTimeStamp: function (e, t) {
					r = e;
				},
				setVideoSizeCallback: function (e) {
					o = e;
				},
				setAudioStartCallback: function (e) {
					a = e;
				},
				setMseErrorCallback: function (e) {
					u = e;
				},
				getPlaybackTimeStamp: function () {
					return r;
				},
				setSpeedPlay: function (e) {
					f = e;
				},
				setvideoTimeStamp: function (e) {
					var t = Math.abs(p.timestamp - e.timestamp) > 3;
					d.timestamp,
						!0 === t && ((T = 0), a((d = e).timestamp, 'init'), 0 !== p.timestamp && g && (C.currentTime = E.duration - 0.1), (m = null)),
						(p = e);
				},
				pause: function () {
					(V = !0), ee();
				},
				play: function () {
					V = !1;
				},
				setPlaybackFlag: function (e) {
					g = e;
				},
				setTimeStampInit: function () {
					(m = null), (d = { timestamp: 0, timestamp_usec: 0, timezone: 0 });
				},
				close: function () {
					J(), ee();
				},
				setBeginDrawCallback: function (e) {
					l = e;
				},
				setErrorCallback: function (e) {
					G = e;
				},
				terminate: function () {
					null !== C &&
						(J(),
						'open' === E.readyState && (I && E.removeSourceBuffer(I), E.endOfStream()),
						(I = null),
						(E = null),
						(C = null),
						D && (clearInterval(D), (D = null)),
						F && (clearInterval(F), (F = null)),
						(H = 0),
						(N = 0),
						(L = 0),
						(K = !1),
						(j = !1));
				},
				getDuration: function () {
					return C.duration - C.currentTime;
				},
				setFPS: function (e) {
					e && (z = e);
				},
				setRtspOver: function () {
					C.duration.toFixed(4) - 0 === C.currentTime.toFixed(4) - 0 ||
						((L = parseInt(C.currentTime)),
						(N = parseInt(C.duration)),
						(F = setInterval(function () {
							L === parseInt(C.currentTime) && N === parseInt(C.duration)
								? H++ > 10 && (F && clearInterval(F), (F = null))
								: parseInt(C.currentTime) >= parseInt(C.duration)
									? (F && clearInterval(F), (F = null))
									: ((L = parseInt(C.currentTime)), (N = parseInt(C.duration)), (H = 0));
						}, 150)));
				},
				getVideoBufferQueueSize: function () {
					return x.length;
				},
				playNextFrame: function () {
					te();
				},
				getCurFrameInfo: function () {
					return (
						(Y.src = (function () {
							var e = document.createElement('canvas');
							return (e.width = C.videoWidth), (e.height = C.videoHeight), e.getContext('2d').drawImage(C, 0, 0, e.width, e.height), e.toDataURL();
						})()),
						Y
					);
				},
				setDecodeType: function (e) {
					n = e;
				},
			};
			var ve = (function (e) {
				var t = e.document,
					n = function () {
						return e.URL || e.webkitURL || e;
					},
					r = t.createElementNS('http://www.w3.org/1999/xhtml', 'a'),
					o = 'download' in r,
					a = /constructor/i.test(e.HTMLElement),
					i = /CriOS\/[\d]+/.test(navigator.userAgent),
					s = function (t) {
						(e.setImmediate || e.setTimeout)(function () {
							throw t;
						}, 0);
					},
					l = function (e) {
						setTimeout(function () {
							'string' === typeof e ? n().revokeObjectURL(e) : e.remove();
						}, 4e4);
					},
					u = function (e) {
						return /^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(e.type)
							? new Blob([String.fromCharCode(65279), e], { type: e.type })
							: e;
					},
					c = function (t, c, f) {
						f || (t = u(t));
						var p,
							d = this,
							m = 'application/octet-stream' === t.type,
							g = function () {
								!(function (e, t, n) {
									for (var r = (t = [].concat(t)).length; r--; ) {
										var o = e['on' + t[r]];
										if ('function' === typeof o)
											try {
												o.call(e, n || e);
											} catch (e) {
												s(e);
											}
									}
								})(d, 'writestart progress write writeend'.split(' '));
							};
						if (((d.readyState = d.INIT), o))
							return (
								(p = n().createObjectURL(t)),
								void setTimeout(function () {
									(r.href = p),
										(r.download = c),
										(function (e) {
											var t = new MouseEvent('click');
											e.dispatchEvent(t);
										})(r),
										g(),
										l(p),
										(d.readyState = d.DONE);
								})
							);
						!(function () {
							if ((i || (m && a)) && e.FileReader) {
								var r = new FileReader();
								return (
									(r.onloadend = function () {
										var t = i ? r.result : r.result.replace(/^data:[^;]*;/, 'data:attachment/file;');
										e.open(t, '_blank') || (e.location.href = t), (t = void 0), (d.readyState = d.DONE), g();
									}),
									r.readAsDataURL(t),
									void (d.readyState = d.INIT)
								);
							}
							p || (p = n().createObjectURL(t)),
								m ? (e.location.href = p) : e.open(p, '_blank') || (e.location.href = p),
								(d.readyState = d.DONE),
								g(),
								l(p);
						})();
					},
					f = c.prototype;
				return 'undefined' !== typeof navigator && navigator.msSaveOrOpenBlob
					? function (e, t, n) {
							return (t = t || e.name || 'download'), n || (e = u(e)), navigator.msSaveOrOpenBlob(e, t);
						}
					: ((f.readyState = f.INIT = 0),
						(f.WRITING = 1),
						(f.DONE = 2),
						(f.error = f.onwritestart = f.onprogress = f.onwrite = f.onabort = f.onerror = f.onwriteend = null),
						function (e, t, n) {
							return new c(e, t || e.name || 'download', n);
						});
			})(window);
			return new X();
		};
		function z(e, t) {
			var n = Object.keys(e);
			if (Object.getOwnPropertySymbols) {
				var r = Object.getOwnPropertySymbols(e);
				t &&
					(r = r.filter(function (t) {
						return Object.getOwnPropertyDescriptor(e, t).enumerable;
					})),
					n.push.apply(n, r);
			}
			return n;
		}
		function q(e) {
			for (var t = 1; t < arguments.length; t++) {
				var n = null != arguments[t] ? arguments[t] : {};
				t % 2
					? z(Object(n), !0).forEach(function (t) {
							K(e, t, n[t]);
						})
					: Object.getOwnPropertyDescriptors
						? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n))
						: z(Object(n)).forEach(function (t) {
								Object.defineProperty(e, t, Object.getOwnPropertyDescriptor(n, t));
							});
			}
			return e;
		}
		function K(e, t, n) {
			return t in e ? Object.defineProperty(e, t, { value: n, enumerable: !0, configurable: !0, writable: !0 }) : (e[t] = n), e;
		}
		function j(e, t) {
			return (t = (t = t.toLowerCase())[0].toUpperCase() + t.substr(1)), Object.prototype.toString.call(e) === '[object ' + t + ']';
		}
		function X(e, t, n) {
			if ((void 0 === n && (n = 2), void 0 === t && (t = 0), (e = e.toString()).length >= n)) return e;
			var r = n - e.length;
			return new Array(r).fill(String(t)).join('') + e;
		}
		function Z(e, t) {
			return void 0 !== e && e
				? ((t = t || new Date()),
					(e = (e = (e = (e = (e = (e = e.replace(/y/gi, X(t.getFullYear()), 0)).replace(/m/gi, X(t.getMonth() + 1), 0)).replace(
						/d/gi,
						X(t.getDate()),
						0
					)).replace(/h/gi, X(t.getHours()), 0)).replace(/i/gi, X(t.getMinutes()), 0)).replace(/s/gi, X(t.getSeconds()), 0)))
				: '';
		}
		function J(e, t) {
			var n = (e = e || {}).nameFormat || ['ymd_his'];
			t = t || new Date();
			var r = '';
			if (j(n, 'string')) n = [n, {}];
			else {
				if (!j(n, 'array'))
					return void (function (e) {
						throw new Error(e);
					})('name format must be string or array');
				j(n[0], 'string') || (n[0] = 'ymd_his'), j(n[1], 'object') || (n[1] = {});
			}
			var o = n[0].split(/\{(?:[^{}]+)\}/),
				a = n[1];
			n[0].replace(/\{([^{}]*)\}/g, function (e, t, n) {
				o.shift();
				(r += Z()), (r += t in a ? a[t] : e);
			});
			var i = o.shift();
			return (r += Z(i, t));
		}
		function Q(e, t) {
			(this.name = e), (this.allowUpDateName = !0), (this.byteLength = 0), (this.options = t), (this.startTime = new Date().toLocaleString());
		}
		(Q.prototype.setEndTime = function () {
			this.endTime = new Date().toLocaleString();
		}),
			(Q.prototype.updateNameByStream = function (e, t) {
				if (this.allowUpDateName) {
					var n = new Uint8Array(t),
						r = ((n[19] << 24) + (n[18] << 16) + (n[17] << 8) + n[16]) >>> 0,
						o = '20' + (r >> 26) + '/' + ((r >> 22) & 15) + '/' + ((r >> 17) & 31) + ' ' + ((r >> 12) & 31) + ':' + ((r >> 6) & 63) + ':' + (63 & r);
					(this.name = J(e, new Date(o))), (this.allowUpDateName = !1), (n = null);
				}
				t = null;
			});
		var $ = new (function () {
			var e = { count: 0, total: 0, group: [] },
				t = function () {};
			return (
				(t.prototype.add = function (t) {
					e.count++, (e.total += t.byteLength), e.group.push(t);
				}),
				(t.prototype.get = function (t) {
					return t in e ? e[t] : e;
				}),
				new t()
			);
		})();
		var ee = function () {
				var e = 1048576,
					t = null,
					n = null,
					r = 0,
					o = void 0,
					a = null,
					i = 0,
					s = null;
				function l() {
					(this.onMessage = function () {}),
						(this.postMessage = function (e) {
							this.__onMessage(e);
						}),
						(this.__postMessage = function (e) {
							this.onMessage(e);
						});
				}
				return (
					(l.prototype.__onMessage = function (e) {
						var t = e;
						switch (t.type) {
							case 'init':
								this.init(t.options);
								break;
							case 'addBuffer':
								this.addBuffer(t);
								break;
							case 'close':
								this.close();
						}
					}),
					(l.prototype.init = function (t) {
						(this.fullSize = t.fullSize || 1 / 0),
							(this.singleSize = t.singleSize + 20 * e || 520 * e),
							(o = 'init'),
							(s = t.recordName),
							(this.limitOptions = Object.assign({ limitBy: 'fullSize' }, t.limitOptions)),
							(this.nameOptions = Object.assign({ namedBy: 'date', nameFormat: ['ymd_his', {}] }, t.nameOptions));
					}),
					(l.prototype._malloc = function (e) {
						t && n && ((n = null), (t = null)), (t = new ArrayBuffer(e)), (n = new DataView(t));
						var r = this.nameOptions,
							o = '';
						if (null != s) o = s;
						else
							switch (this.nameOptions.namedBy.toLowerCase()) {
								case 'date':
									o = J(r);
									break;
								default:
									o = J();
							}
						a = new Q(o);
					}),
					(l.prototype._initVideoMem = function () {
						!t && this.singleSize && this._malloc(this.singleSize);
					}),
					(l.prototype.appendVideoBuf = function (t, o, a) {
						var s = t.byteLength,
							l = 0;
						if ((l = 5 == i ? o + s : r + s) > this.singleSize - 20 * e) this.inNodePlace(), this.addBuffer({ buffer: t });
						else {
							if (5 == i) {
								for (var u = o; u < l; u++) n.setUint8(u, t[u - o]);
								l > r && (r = l);
							} else {
								for (u = r; u < l; u++) n.setUint8(u, t[u - r]);
								r = l;
							}
							this.__postMessage({ type: 'pendding', size: r, total: this.singleSize });
						}
					}),
					(l.prototype.addBuffer = function (e) {
						if ('closed' !== o) {
							var t = e.buffer,
								n = e.offset;
							(i = e.recordType), this._initVideoMem(), (o = 'addBuffer');
							var a = t.length,
								s = 0;
							(s = 5 == i ? n + a : r + a), $.get('total') + s > this.fullSize ? this.close() : this.appendVideoBuf(t, n);
						}
					}),
					(l.prototype.inNodePlace = function () {
						if ('addBuffer' === o) {
							(o = 'download'), a.updateNameByStream(this.nameOptions, t.slice(0, 20)), (a.byteLength = r), a.setEndTime(), $.add(a);
							var e = t.slice(0, r);
							if (
								(this.reset(),
								this.__postMessage({ type: 'download', data: q(q({}, a), {}, { buffer: e }) }),
								(e = null),
								'count' === this.limitOptions.limitBy)
							) {
								var n = this.limitOptions.count;
								n && n === $.get('count') && this.close();
							}
						}
					}),
					(l.prototype.reset = function () {
						(r = 0), this._malloc(this.singleSize);
					}),
					(l.prototype.close = function () {
						this.inNodePlace(),
							'closed' !== o &&
								void 0 !== o &&
								((o = 'closed'), this.__postMessage({ type: 'closed', message: 'record was closed' }), (t = null), (n = null));
					}),
					new l()
				);
			},
			te = function (e) {
				var t = e,
					n = 48e3,
					r = 132,
					o = 4,
					a = 15,
					i = [255, 511, 1023, 2047, 4095, 8191, 16383, 32767],
					s = 8e3,
					l = null;
				function u() {}
				function c(e) {
					var t, n;
					return e < 0 ? ((e = r - e), (t = 127)) : ((e += r), (t = 255)), (n = f(e, i)) >= 8 ? 127 ^ t : ((n << 4) | ((e >> (n + 3)) & 15)) ^ t;
				}
				function f(e, t) {
					for (var n = 0, r = t.length; n < r; n++) if (e <= t[n]) return n;
					return t.length;
				}
				function p(e) {
					var t, n, r;
					return (
						e >= 0 ? (t = 213) : ((t = 85), (e = -e - 8)),
						(n = f(e, i)) >= 8 ? 127 ^ t : ((r = n << o), (r |= n < 2 ? (e >> 4) & a : (e >> (n + 3)) & a) ^ t)
					);
				}
				return (
					(u.prototype = {
						setSampleRate: function (e) {
							n = e;
						},
						encode: function (e) {
							var r = null;
							null !== l ? ((r = new Float32Array(e.length + l.length)).set(l, 0), r.set(e, l.length)) : (r = e),
								(r = (function (e, t) {
									if (t === n) return e;
									for (var r = n / t, o = Math.floor(e.length / r), a = new Float32Array(o), i = 0, s = 0; i < a.length; ) {
										for (var u = Math.round((i + 1) * r), c = 0, f = 0, p = s, d = e.length; p < u && p < d; p++) (c += e[p]), f++;
										(a[i] = c / f), i++, (s = u);
									}
									if (((l = null), Math.round(i * r) !== e.length)) {
										var m = Math.round(i * r);
										l = new Float32Array(e.subarray(m, e.length));
									}
									return a;
								})(r, s));
							for (var o = new Int16Array(r.length), a = new Uint8Array(o.length), i = 0, u = r.length; i < u; i++)
								(o[i] = r[i] * Math.pow(2, 15)), (a[i] = 0 == t ? p(o[i]) : c(o[i]));
							return a;
						},
					}),
					new u()
				);
			},
			ne = function (e, t) {
				var n = t,
					r = null,
					o = null,
					a = [36, e, 0, 0, 0, 0],
					i = [68, 72, 65, 86],
					s = [100, 104, 97, 118],
					l = 245,
					u = 0,
					c = null;
				function f(e, t, n) {
					var r = [],
						o = t || 4;
					if (!0 === n) for (var a = 0; a < o; a++) r[a] = (e >>> (8 * (o - 1 - a))) & 255;
					else for (var i = 0; i < o; i++) r[i] = (e >>> (8 * i)) & 255;
					return r;
				}
				function p() {
					o = new te(n);
				}
				return (
					(p.prototype = {
						setSampleRate: function (e) {
							o.setSampleRate(e);
						},
						getRTPPacket: function (t) {
							var p = o.encode(t),
								d = 0;
							(r = new Uint8Array(a.length + 40 + p.length + 8)).set([36, e], d),
								(d += 2),
								r.set(f(40 + p.length + 8, 4, !0), d),
								(d += 4),
								r.set(i, d),
								(d += 4),
								r.set([240], d),
								(d += 1),
								r.set([0], d),
								(d += 1),
								r.set([1], d),
								(d += 1),
								r.set([0], d),
								(d += 1),
								l > 65535 && (l = 240),
								r.set(f(l), d),
								(d += 4),
								l++;
							var m = f(40 + p.length + 8);
							r.set(m, d), (d += 4);
							var g = new Date(),
								S =
									((g.getFullYear() - 2e3) << 26) +
									((g.getMonth() + 1) << 22) +
									(g.getDate() << 17) +
									(g.getHours() << 12) +
									(g.getMinutes() << 6) +
									g.getSeconds(),
								h = g.getTime(),
								_ = null === c ? 0 : h - c;
							(c = h), (u += _) > 65535 && (u = 65535 - u), r.set(f(S), d), (d += 4), r.set(f(u, 2), d), (d += 2), r.set([16], d), (d += 1);
							var v = (function (e, t) {
								for (var n = 0, r = t; r < e.length; r++) n += e[r];
								return n;
							})(r, 6);
							r.set([v], d), (d += 1);
							var y = [131, 1, 0 == n ? 14 : 10, 2];
							r.set(y, d), (d += 4), r.set([150, 1, 0, 0], d), (d += 4);
							var T = (function (e, t) {
								for (var n = 0, r = 0; r < t; r++) n += e[r] << ((r % 4) * 8);
								return n;
							})(p, p.length);
							return (
								r.set([136], d),
								(d += 1),
								r.set(f(T), d),
								(d += 4),
								r.set([0, 0, 0], d),
								(d += 3),
								r.set(p, d),
								(d += p.length),
								r.set(s, d),
								(d += 4),
								r.set(m, d),
								r
							);
						},
						terminate: function () {
							o = null;
						},
					}),
					new p(e)
				);
			},
			re = function () {
				var e = null,
					t = null,
					n = null,
					r = null,
					o = null,
					a = !1,
					i = null,
					s = { audio: !0, video: !1 },
					l = null;
				function u() {}
				return (
					(u.prototype = {
						initAudioOut: function (u, c) {
							if (void 0 === t || null === t)
								try {
									(window.AudioContext =
										window.AudioContext || window.webkitAudioContext || window.mozAudioContext || window.oAudioContext || window.msAudioContext),
										((t = new AudioContext()).onstatechange = function () {});
								} catch (e) {
									return;
								}
							if (
								((null !== n && null !== r) ||
									((n = t.createGain()),
									((r = t.createScriptProcessor(4096, 1, 1)).onaudioprocess = function (t) {
										if (null !== i) {
											var n = t.inputBuffer.getChannelData(0);
											if (null !== l && !0 === a) {
												var r = e.getRTPPacket(n);
												l(r);
											}
										}
									}),
									n.connect(r),
									r.connect(t.destination),
									(o = t.sampleRate),
									(n.gain.value = 1)),
								void 0 === navigator.mediaDevices && (navigator.mediaDevices = {}),
								void 0 === navigator.mediaDevices.getUserMedia &&
									(navigator.mediaDevices.getUserMedia = function (e, t, n) {
										var r = navigator.getUserMedia || navigator.webkitGetUserMedia || navigator.mozGetUserMedia || navigator.msGetUserMedia;
										return r
											? new Promise(function (t, n) {
													r.call(navigator, e, t, n);
												})
											: (n(), Promise.reject(new Error('getUserMedia is not implemented in this browser')));
									}),
								navigator.mediaDevices.getUserMedia)
							)
								return (
									navigator.mediaDevices
										.getUserMedia(s)
										.then(function (e) {
											(i = e), t.createMediaStreamSource(e).connect(n);
										})
										.catch(function (e) {}),
									(a = !0),
									e || (e = new ne(0, c)).setSampleRate(o),
									o
								);
						},
						controlVolumnOut: function (e) {
							var t = (e / 20) * 2;
							n.gain.value = t <= 0 ? 0 : t >= 10 ? 10 : t;
						},
						stopAudioOut: function () {
							if (null !== i && a)
								try {
									for (var e = i.getAudioTracks(), t = 0, n = e.length; t < n; t++) e[t].stop();
									(a = !1), (i = null);
								} catch (e) {}
						},
						terminate: function () {
							this.stopAudioOut(), t.close(), (n = null), (r = null), e && (e.terminate(), (e = null));
						},
						setSendAudioTalkBufferCallback: function (e) {
							l = e;
						},
					}),
					new u()
				);
			},
			oe = 0,
			ae = 2,
			ie = 18,
			se = 19,
			le = 20,
			ue = 2,
			ce = 4,
			fe = 8,
			pe = 8,
			de = 13,
			me = 2057,
			ge = function (e) {
				var t,
					n,
					i,
					s,
					l,
					u = 0,
					c = { timestamp: 0, timestamp_usec: 0 },
					f = null,
					p = null,
					d = null,
					m = !1,
					g = null,
					S = null,
					h = null,
					_ = null,
					v = null,
					y = null,
					T = 1,
					A = '',
					b = !1,
					P = null,
					C = 0,
					E = 0,
					I = { id: 1, samples: null, baseMediaDecodeTime: 0 },
					w = 0,
					D = null,
					O = 2,
					U = 0,
					k = 0,
					F = 0,
					L = 1,
					N = null,
					H = 0,
					B = null,
					G = null,
					V = null,
					z = null,
					q = null,
					K = null,
					j = null,
					X = null,
					Z = null,
					J = null,
					Q = null,
					$ = null,
					te = null,
					ne = null,
					ge = null,
					Se = null,
					he = null,
					_e = null,
					ve = 0,
					ye = 0,
					Te = 0,
					Ae = 0,
					be = 0,
					Pe = 0,
					Ce = null,
					Ee = null,
					Ie = null,
					we = null,
					Re = null,
					Me = null,
					De = null,
					Oe = null,
					Ue = null,
					ke = null,
					Fe = null,
					Le = null,
					Ne = null,
					He = null,
					Be = null,
					Ge = 0,
					Ve = 0,
					We = null,
					xe = 0,
					Ye = 0,
					ze = e,
					qe = !0,
					Ke = !1,
					je = !1,
					Xe = !1,
					Ze = 0,
					Je = 0,
					Qe = !1,
					$e = !1,
					et = 0,
					tt = null,
					nt = null,
					rt = null,
					ot = null,
					at = 0,
					it = -1,
					st = !1,
					lt = !1,
					ut = '',
					ct = null,
					ft = null,
					pt = 0,
					dt = 0,
					mt = !1,
					gt = !1,
					St = !1,
					ht = '0',
					_t = !0,
					vt = 0,
					yt = 0,
					Tt = 0,
					At = 0,
					bt = 45,
					Pt = 0,
					Ct = !1,
					Et = !1,
					It = !1,
					wt = '',
					Rt = '',
					Mt = '',
					Dt = !1,
					Ot = 0,
					Ut = [{}, {}, {}];
				function kt() {}
				function Ft() {
					null != g && (g.setDecodeType(Ye), g.setCodecInfo(A), g.setInitSegmentFunc(Ht), g.setSpeedPlay(T), g.setFPS(C));
				}
				function Lt() {
					null != g &&
						(g.setVideoSizeCallback(Bt), g.setBeginDrawCallback(G), g.setErrorCallback(Q), g.setAudioStartCallback(Nt), g.setMseErrorCallback(Gt));
				}
				function Nt(e, t) {}
				function Ht() {
					return P;
				}
				function Bt() {
					null !== J && J(!1);
				}
				function Gt(e) {
					switch (e) {
						case 'InitError':
							if ((1 == Ye ? (qe = !1) : (Ke = !1), ze)) Module._PLAY_SetSupportWebMSE(u, qe, Ke);
							else {
								var t = { nType: 'SetSupportWebMSE', bSupportH264MSE: qe, bSupportH265MSE: Ke };
								ct && ct.postMessage(t);
							}
							break;
						case 'Error':
						case 'SourceError':
						case 'SourceBufferError':
							Qe = !0;
					}
				}
				function Vt() {
					g && (g.close(), g.terminate(), (g = null)),
						(P = null),
						(S = null),
						(h = null),
						(b = !1),
						($e = !1),
						(U = 0),
						(I = { id: 1, samples: null, baseMediaDecodeTime: 0 }),
						(w = 0),
						(L = 1),
						(F = 0),
						(H = 0),
						(k = 0),
						(O = 2);
				}
				function Wt(e, t) {
					var n = Module._malloc(4),
						r = Module._malloc(4);
					Module._PLAY_GetVRCoord2DTrans(u, 0, e, t, n, r);
					var o = Module.HEAPF32[n / 4],
						a = Module.HEAPF32[r / 4];
					return Module._free(n), Module._free(r), [((o + 1) / 2) * d.width, ((1 - a) / 2) * d.height];
				}
				function xt(e, r, o, a, f) {
					pt >= f.nTotalStreamLength && (dt = pt - f.nTotalStreamLength);
					var m,
						W,
						x = Date.UTC(f.nYear, f.nMonth, f.nDay, f.nHour, f.nMinute, f.nSecond) / 1e3;
					if (1 == f.nFrameType) {
						if (((Pe = f.nRemainData), Xe && 0 == Pe && Z(), f.bThrowFrame)) return;
						if (
							(pe == f.nStreamType ? (c.timestamp = x) : (c.timestamp = f.nTimeStamp / 1e3),
							(c.timestamp_usec = 0),
							ue == f.nEncodeType || ce == f.nEncodeType || fe == f.nEncodeType ? (Ye = 1) : 12 == f.nEncodeType && (Ye = 2),
							(ve = f.nWidth),
							(ye = f.nHeight),
							0 == ve || 0 == ye)
						)
							return;
						if (
							((C = f.nFrameRate),
							Ze <= 5 && Ze++,
							ie == f.nFrameSubType || se == f.nFrameSubType || le == f.nFrameSubType ? (be = 1) : 0 == f.nFrameSubType && (be = 0),
							ae == f.nFrameSubType && !mt)
						) {
							if (((mt = !0), 1 == Ye ? (qe = !1) : 2 == Ye && (Ke = !1), ze)) Module._PLAY_SetSupportWebMSE(u, qe, Ke);
							else {
								var K = { nType: 'SetSupportWebMSE', bSupportH264MSE: qe, bSupportH265MSE: Ke };
								ct && ct.postMessage(K);
							}
							return;
						}
						if (((1 == Ye && 1 == qe) || (2 == Ye && 1 == Ke)) && !be && de != f.nStreamType) {
							if (((m = f.nFrameID), (W = f.nFrameSubType), oe != W && ie != W && le != W && -1 != it && m != it + 1)) return;
							if (
								(1 != je && ((je = !0), ze || (We && We.CleanScreen(0, 0, 0, 0))),
								(it = f.nFrameID),
								(ve == Te && ye == Ae && f.nEncodeType == xe) || (0 != Te && (Qe = !0), (Te = ve), (Ae = ye), (xe = f.nEncodeType)),
								C != E && ((b = !1), g && g.ResetInitSegmentFlag(), (E = C)),
								Qe && (Vt(), (Qe = !1)),
								0 == $e && 0 != f.nFrameSubType)
							)
								return;
							null == S && (S = new M(Ye)),
								null == h && (h = new R(Ye)),
								(function (e, t, n) {
									for (var r = null, o = e.length, a = [], i = 0; i <= o; )
										if (0 == e[i])
											if (0 == e[i + 1])
												if (1 == e[i + 2]) {
													if ((a.push(i), (i += 3), 1 == Ye)) {
														if (5 == (31 & e[i]) || 1 == (31 & e[i])) break;
													} else if (2 == Ye && (38 == (255 & e[i]) || 2 == (255 & e[i]))) break;
												} else 0 == e[i + 2] ? i++ : (i += 3);
											else i += 2;
										else i += 1;
									var s = 0;
									if (1 == Ye) {
										for (i = 0; i < a.length; i++)
											switch (((r = e.subarray(a[i] + 3, a[i + 1])), 31 & e[a[i] + 3])) {
												case 1:
												case 5:
													(s = a[i] - 1), (B = e.subarray(s, e.length));
													break;
												case 7:
													S.parse(r), (v = r);
													break;
												case 8:
													y = r;
											}
										if (!b) {
											b = !0;
											var l = {
												id: 1,
												width: ve,
												height: ye,
												type: 'video',
												profileIdc: S.getSpsValue('profile_idc'),
												profileCompatibility: 0,
												levelIdc: S.getSpsValue('level_idc'),
												sps: [v],
												pps: [y],
												timescale: 1e3,
												fps: C,
											};
											(P = h.initSegment(l)), (A = S.getCodecInfo());
										}
									} else if (2 == Ye) {
										for (i = 0; i < a.length; i++)
											switch (((r = e.subarray(a[i] + 3, a[i + 1] - 1)), 255 & e[a[i] + 3])) {
												case 2:
												case 38:
													(s = a[i] - 1), (B = e.subarray(s, e.length));
													break;
												case 64:
													_ = r;
													break;
												case 66:
													var u = e.subarray(a[i] + 5, a[i + 1] - 1);
													S.parse(u), (v = r);
													break;
												case 68:
													y = r;
											}
										if (!b) {
											b = !0;
											var c = S.getSpsValue('general_profile_space'),
												f = S.getSpsValue('general_tier_flag'),
												p = S.getSpsValue('general_profile_idc'),
												d = S.getSpsValue('temporalIdNested');
											(l = {
												id: 1,
												width: ve,
												height: ye,
												type: 'video',
												general_profile_flag: (c << 6) | (f << 5) | p,
												general_profile_compatibility_flags: S.getSpsValue('general_profile_compatibility_flags'),
												general_constraint_indicator_flags: S.getSpsValue('general_constraint_indicator_flags'),
												general_level_idc: S.getSpsValue('general_level_idc'),
												chroma_format_idc: S.getSpsValue('chroma_format_idc'),
												bitDepthLumaMinus8: S.getSpsValue('bitDepthLumaMinus8'),
												bitDepthChromaMinus8: S.getSpsValue('bitDepthChromaMinus8'),
												rate_layers_nested_length: 11 | ((1 & d) << 2),
												vps: [_],
												sps: [v],
												pps: [y],
												timescale: 1e3,
												fps: C,
											}),
												(P = h.initSegment(l));
										}
									}
								})(e, f.nFrameSubType, f.nFrameID),
								0 == $e &&
									(null == g && (g = new Y()).init(p),
									((j = { decodeMode: 'video' }).width = ve),
									(j.height = ye),
									[2, 4, 8].includes(f.nEncodeType) ? (j.encodeMode = 'H264') : 12 === f.nEncodeType && (j.encodeMode = 'H265'),
									V(j),
									Lt(),
									Ft(),
									($e = !0)),
								lt && ((lt = !1), g.capturePic([p], ut)),
								g && g.setvideoTimeStamp(c),
								(function () {
									if (null != B) {
										var e = { duration: Math.round((1 / C) * 1e3), size: B.length, frame_time_stamp: null, frameDuration: null };
										(e.frameDuration = e.duration),
											null == I.samples && (I.samples = new Array(O)),
											(I.samples[U++] = e),
											(k += e.frameDuration),
											(F += e.frameDuration);
										var t = B.length - 4;
										(B[0] = (4278190080 & t) >>> 24), (B[1] = (16711680 & t) >>> 16), (B[2] = (65280 & t) >>> 8), (B[3] = 255 & t);
										var n = new Uint8Array(B.length + w);
										if ((0 !== w && n.set(D), n.set(B, w), (w = (D = n).length), U % O === 0 && 0 !== U)) {
											if ((null !== I.samples[0].frameDuration && ((I.baseMediaDecodeTime = 1 === L ? 0 : H), (H = k)), 1 == T))
												for (var r = I.samples.length, o = F / O, a = 0; a < r; a++) I.samples[a].frameDuration = o;
											(F = 0),
												(N = h.mediaSegment(L, I, D, I.baseMediaDecodeTime)),
												L++,
												(U = 0),
												(D = null),
												(w = 0),
												null !== g ? g.setMediaSegment(N) : !1 === b && Ft(),
												2 == O && ((O = 1), (I.samples = null), (I.samples = new Array(O)));
										}
									}
								})(),
								We && We.DrawDrawIVS(f.nFrameID);
						} else {
							if (!ze && (null == e || null == r || null == o)) return;
							var j;
							0 != je && ((je = !1), Vt(), (Qe = !0), (Te = 0), (Ae = 0)),
								(ve != Te || ye != Ae) &&
									((Te = ve),
									(Ae = ye),
									ze || We.resize(ve, ye),
									((j = { decodeMode: 'canvas' }).width = ve),
									(j.height = ye),
									[2, 4, 8].includes(f.nEncodeType) ? (j.encodeMode = 'H264') : 12 === f.nEncodeType && (j.encodeMode = 'H265'),
									V(j)),
								st || ((st = !0), G('PlayStart')),
								ze || (We && We.draw(e, r, o, f.nFrameID, C)),
								(function () {
									if ('0' !== ht && t && i && s && l) {
										i.clearRect(0, 0, d.width, d.height);
										var e = Wt(10, 10);
										i.drawImage(s, e[0], e[1], s.width, s.height),
											(e = Wt(d.width / 4, d.height / 4)),
											i.drawImage(s, e[0], e[1], s.width, s.height),
											(e = Wt(d.width / 2, d.height / 2)),
											i.drawImage(s, e[0], e[1], s.width, s.height),
											(e = Wt((3 * d.width) / 4, (3 * d.height) / 4)),
											i.drawImage(l, e[0], e[1], l.width, l.height),
											i.restore(),
											t.clearRect(0, 0, d.width, d.height),
											t.drawImage(n, 0, 0, d.width, d.height);
									}
								})();
						}
						var X = f.nYear,
							J = qt(f.nMonth),
							Q = qt(f.nDay),
							$ = qt(f.nHour),
							ee = qt(f.nMinute),
							te = qt(f.nSecond);
						(f.timeStamp = Date.UTC(X, J, Q, $, ee, te) / 1e3),
							(f.utcTimeStamp = new Date(''.concat(X, '-').concat(J, '-').concat(Q, ' ').concat($, ':').concat(ee, ':').concat(te)).getTime()),
							z(f);
					} else if (2 == f.nFrameType) {
						if ((Je <= 10 && Je++, !gt && Ze < 5 && Je <= 10)) {
							if (C > 5 || 0 == C) return;
							if (Ze < 2) return;
						}
						if (
							((f.nSamples == Ge && f.nBits == Ve) || ((Ge = f.nSamples), (Ve = f.nBits), Fe.setSamplingRate(f.nSamples)),
							Fe && Fe.bufferAudio(e, 0),
							ze)
						) {
							var ne = Fe.getAudioBufTime();
							setTimeout(function () {
								Module._PLAY_SetInt32(u, me, ne);
							});
						}
						q(f);
					}
				}
				function Yt(e) {
					var t,
						n,
						r,
						o,
						a,
						i,
						s,
						l = e.data.msgType,
						c = e.data.nPort,
						p = e.data.msgData,
						d = 0,
						g = 0;
					switch ((f && ((d = parseInt(f.width)), (g = parseInt(f.height))), l)) {
						case 'LoadSuccess':
							var S = {
								nType: 'Init',
								option: { bPlayback: m, bSupportMultiThread: ze, bSupportH264MSE: qe, bSupportH265MSE: Ke, nCanvasWidth: d, nCanvasHeight: g },
							};
							if (
								(ct.postMessage(S),
								(Et = !0),
								It || ((It = !0), 0 != wt.length && 0 != Rt.length && 0 != Mt.length && GetOriginalKey(wt, Rt, Mt)),
								!Dt)
							)
								for (var h = 0; h < 3; h++) void 0 != Ut[h].nFrameType && SetWebSecurityKey(Ot, Ut[h].nFrameType, Ut[h].strKey, Ut[h].stStreamInfo);
							break;
						case 'InitSuccess':
							te((u = c));
							break;
						case 'VisibleDecCallBack':
							ne(), xt(p.pBufY, p.pBufU, p.pBufV, p.nSize, p.stuFrameInfo);
							break;
						case 'IVSDataCallBack':
							(o = p.pBuf), (a = p.nType), (i = p.nLen), (s = p.nReallen), We && We.DrawIVS(o, a, i, s);
							break;
						case 'RecordDataCallBack':
							(t = p.pRecordData),
								p.nLen,
								(n = p.Offset),
								(r = p.stuFrameInfo).nYear,
								r.nMonth,
								r.nDay,
								r.nHour,
								r.nMinute,
								r.nSecond,
								tt.postMessage({ type: 'addBuffer', buffer: t, offset: n, recordType: at }),
								p.Offset < et ? (tt.postMessage({ type: 'close' }), (tt = null), (et = 0)) : (et = p.Offset);
							break;
						case 'DecryptionResultCallBack':
							p.bSuccess, X(p.bSuccess);
							break;
						case 'CatchPicCallBack':
							zt(p.blob, ut);
							break;
						case 'GetOriginalKeyCallBack':
							j(p);
					}
				}
				kt.prototype = {
					Init: function (e) {
						(f = e.canvasElem), (p = e.videoElem), (d = e.ivsCanvasElem), (m = e.bPlayBack);
						var t = 1;
						(Pt = f && f.height),
							(Ke = (function () {
								var e = o(),
									t = a(e),
									n = !1;
								switch (e) {
									case r.Chrome:
										n = t >= 104;
										break;
									default:
										n = 0;
								}
								return n;
							})());
						var n = navigator.platform,
							i = o();
						if ((0 == n.indexOf('iPhone') && 'Safari' == i && ((qe = !1), (Ke = !1)), ze)) {
							var s = Module._malloc(1);
							if (
								((ge = new Uint8Array(Module.HEAPU8.buffer, s, 1)),
								Module._PLAY_GetFreePort(ge.byteOffset),
								(u = ge[0]),
								(ge = null),
								Module._free(s),
								(t = Module._PLAY_SetStreamOpenMode(u, m)),
								(t = Module._PLAY_OpenStream(u, 0, 0, 10485760)),
								(t = Module._PLAY_SetCacheMode(u, 1)),
								(t = Module._PLAY_SetSupportWebMSE(u, qe, Ke)),
								f)
							) {
								Module._PLAY_ViewResolutionChanged(u, parseInt(f.width), parseInt(f.height), 0);
								var l = Module.allocateUTF8(f.id);
								(t = Module._PLAY_Play(u, l)), Module._free(l);
							} else Module._PLAY_ViewResolutionChanged(u, 0, 0, 0), (t = Module._PLAY_Play(u, 0));
						} else (ct = new Worker(''.concat(e.strDecodeFilePath, '/VideoDecodeWorker.js'))).onmessage = Yt;
						return (
							t &&
								(ze
									? ((Se = Module._malloc(5242880)), (he = new Uint8Array(Module.HEAPU8.buffer, Se, 5242880)))
									: (We = new W(f, d, !0 === m ? 100 : 25, m)),
								(Ke || qe) && p && ((g = new Y()).init(p), Lt())),
							(Fe = new x()) && (Fe.audioInit(1) || (Fe.stop(), (Fe = null))),
							t
						);
					},
					GetPlayPort: function () {
						return u;
					},
					InputData: function (e) {
						var t = 1;
						if (ze) he && (he.set(e), (t = Module._PLAY_InputData(u, he.byteOffset, e.length)));
						else {
							pt += e.length;
							var n = { nType: 'InputData', pData: e };
							ct && ct.postMessage(n);
						}
						return t;
					},
					Pause: function (e) {
						var t = 1;
						if (ze) t = Module._PLAY_Pause(u, e);
						else {
							var n = { nType: 'Pause', bPause: e };
							ct && ct.postMessage(n);
						}
						return t;
					},
					SetPlaySpeed: function (e) {
						var t = 1;
						if (ze) t = Module._PLAY_SetPlaySpeed(u, e);
						else {
							var n = { nType: 'SetPlaySpeed', nSpeed: e };
							ct && ct.postMessage(n);
						}
						return We && We.setPlaySpeed(e), (T = e), t;
					},
					SetSecurityKey: function (e, t, n, r, o) {
						if (ze) {
							var a = Module._malloc(49),
								i = new Uint8Array(Module.HEAPU8.buffer),
								s = 0;
							if (1 == e)
								t.forEach(function (e, t) {
									(i[(a + s) >> 0] = e), s++;
								});
							else if (2 == e) {
								var l = new Uint8Array(16);
								if (((i[(a + s) >> 0] = 1), s++, 0 == o)) {
									for (var c = 0; c < 16; c++) l[c] = 0;
									(o = 16), (r = l);
								}
								r.forEach(function (e, t) {
									(i[(a + s) >> 0] = e), s++;
								}),
									t.forEach(function (e, t) {
										(i[a + s] = e), s++;
									}),
									(n = 1 + n + o),
									(l = null);
							} else
								3 == e &&
									t.split('').forEach(function (e, t) {
										(i[(a + s) >> 0] = e.charCodeAt(0)), s++;
									});
							Module._PLAY_SetSecurityKey(u, a, n), Module._free(a);
						} else {
							var f = { nType: 'SetSecurityKey', nEncryptType: e, szKey: t, nKeyLen: n, szKeyId: r, nKeyIdLen: o };
							ct && ct.postMessage(f);
						}
					},
					StartRecord: function (e, t, n) {
						var r = 1;
						if (
							((tt = new ee()),
							(function (e, t) {
								var n = parseInt(e) || 500;
								tt.postMessage({
									type: 'init',
									options: {
										recordName: t,
										singleSize: 1048576 * n,
										nameOptions: { namedBy: 'date', nameFormat: ['ymd_his'] },
										limitOptions: { limitBy: 'count', count: 10 },
									},
								}),
									(tt.onMessage = function (e) {
										switch (e.type) {
											case 'pendding':
												break;
											case 'download':
												!(function (e, t) {
													var n = new Blob([t]),
														r = document.createElement('a');
													(r.href = URL.createObjectURL(n)), (r.download = e), r.click(), URL.revokeObjectURL(r.href), (r = null), (t = null);
												})(e.data.name, e.data.buffer);
												break;
											case 'closed':
												tt = null;
										}
									});
							})(t, n),
							(at = e),
							ze)
						)
							r = Module._PLAY_StartDataRecord(u, 0, at);
						else {
							var o = { nType: 'StartRecord', nRecordType: at };
							ct && ct.postMessage(o);
						}
						return r;
					},
					StopRecord: function () {
						var e = 1;
						return (
							ze ? (e = Module._PLAY_StopDataRecord(u)) : ct && ct.postMessage({ nType: 'StopRecord' }),
							(ze || 5 != at) && (tt.postMessage({ type: 'close' }), (tt = null)),
							e
						);
					},
					OpenIVSDraw: function (e) {
						var t = 1;
						return (
							ze ? (t = Module._PLAY_RenderPrivateData(u, 1, 0)) : (ct && ct.postMessage({ nType: 'OpenIVSDraw' }), We && We.OpenIVS(e, d.id)), t
						);
					},
					CloseIVSDraw: function () {
						var e = 1;
						return (
							ze
								? ((e = Module._PLAY_RenderPrivateData(u, 0, 0)), je && (e = Module._PLAY_CleanScreen(u, 0, 0, 0, 0, 0)))
								: (ct && ct.postMessage({ nType: 'CloseIVSDraw' }), We && We.CloseIVS()),
							e
						);
					},
					SetIvsEnable: function (e, t) {
						return ze ? Module._PLAY_SetIvsEnable(u, e, t) : We && We.SetIvsEnable(e, t);
					},
					SetPanoAR: function (e) {
						var r = 0;
						return (
							ze &&
								(1 === (r = Module._PLAY_SetPanoVRMode(u, e)) &&
									('0' !== (ht = e)
										? d.getContext &&
											((t = d.getContext('2d')),
											((n = document.createElement('canvas')).width = d.width),
											(n.height = d.height),
											(i = n.getContext('2d')),
											((s = new Image()).src = '360ARTagAsserts/Drops-1.png'),
											((l = new Image()).src = '360ARTagAsserts/Drops-2.png'))
										: (t.clearRect(0, 0, d.width, d.height), (t = null), (n = null), (i = null), (s = null), (l = null))),
								je && (r = 0)),
							r
						);
					},
					Set3DPoint: function (e) {
						ze && (St = e);
					},
					OnMouseDown: function () {
						('0' !== ht || St) && (Ct = !0);
					},
					OnMouseMove: function (e, t) {
						if ('0' !== ht || St) {
							_t && ((vt = e), (yt = t), (_t = !1));
							var n = e - vt,
								r = t - yt;
							if (Ct) {
								var o = Module._malloc(8),
									a = Module._malloc(8);
								Module._PLAY_GetDoubleRegion(u, 0, 2050, o),
									Module._PLAY_GetDoubleRegion(u, 0, 2051, a),
									(Tt = Module.HEAPF64[o / 8]),
									(At = Module.HEAPF64[a / 8]),
									Module._free(o),
									Module._free(a),
									Math.abs(n) >= Math.abs(r) ? (At += (-2 * n * bt) / Pt) : (Tt += (-2 * r * bt) / Pt),
									Module._PLAY_SetStereoRotate(u, 0, Tt, At, 0);
							}
							(vt = e), (yt = t);
						}
					},
					OnMouseUp: function () {
						('0' !== ht || St) && (Ct = !1);
					},
					OnMouseWheel: function (e) {
						('0' !== ht || St) && (e < 0 ? bt >= 10 && (bt -= 2) : bt <= 120 && (bt += 2), Module._PLAY_SetStereoPerspectiveFovy(u, 0, bt));
					},
					SetSoundState: function (e) {
						Fe && Fe.setSoundState(e);
					},
					SetVolume: function (e) {
						Fe && Fe.setVolume(e);
					},
					StartTalk: function (e, t) {
						ft || ((ft = new re()).setSendAudioTalkBufferCallback($), ft.initAudioOut(e, t));
					},
					StopTalk: function () {
						ft && (ft.terminate(), (ft = null));
					},
					GetSourceBufferRemain: function () {
						return ze ? Module._PLAY_GetSourceBufferRemain(u) : dt;
					},
					SetStreamOver: function (e) {
						(Xe = e) && 0 == Pe && Z();
					},
					ResetBuffer: function () {
						ze && (Module._PLAY_ResetBuffer(0), Module._PLAY_ResetBuffer(1), Module._PLAY_ResetBuffer(2));
					},
					capturePic: function (e) {
						if (((ut = e), (1 == Ye && 1 == qe) || (2 == Ye && 1 == Ke))) lt = !0;
						else if (ze) {
							var t = (ve * ye * 3) / 2,
								n = Module._malloc(t),
								r = new Uint8Array(Module.HEAPU8.buffer, n, t),
								o = Module._malloc(4),
								a = new Uint8Array(Module.HEAPU8.buffer, o, 4);
							Module._PLAY_GetPicJPEG(u, r.byteOffset, t, a.byteOffset, 100);
							var i = (a[3] << 24) + (a[2] << 16) + (a[1] << 8) + a[0],
								s = new ArrayBuffer(i),
								l = new Uint8Array(s);
							l.set(Module.HEAPU8.subarray(r.byteOffset, r.byteOffset + i));
							var c = new Blob([l.buffer], { type: 'image/jpg' });
							zt(c, ut), (c = null), Module._free(n), Module._free(o), (r = null), (a = null), (s = null), (l = null);
						} else ct && ct.postMessage({ nType: 'CatchPic' });
					},
					OpenPlayGroup: function () {
						var e = null;
						return ze && (e = Module._PLAY_OpenPlayGroup()), e;
					},
					AddToPlayGroup: function (e, t) {
						var n = 0;
						return ze && (n = Module._PLAY_AddToPlayGroup(e, t)), n;
					},
					DelFromPlayGroup: function (e, t) {
						var n = 0;
						return ze && (n = Module._PLAY_DelFromPlayGroup(e, t)), n;
					},
					ClosePlayGroup: function (e) {
						var t = 0;
						return ze && (t = Module._PLAY_ClosePlayGroup(e)), t;
					},
					PausePlayGroup: function (e, t) {
						var n = 0;
						return ze && (n = Module._PLAY_PausePlayGroup(e, t)), n;
					},
					SetPlayGroupSpeed: function (e, t) {
						var n = 0;
						return ze && (n = Module._PLAY_SetPlayGroupSpeed(e, t)), n;
					},
					SetAudioTalkFlag: function (e) {
						gt = e;
					},
					SetDecodeMode: function (e, t) {
						if (((qe = e), (Ke = t), ze)) Module._PLAY_SetSupportWebMSE(u, e, t);
						else {
							var n = { nType: 'SetSupportWebMSE', bSupportH264MSE: e, bSupportH265MSE: t };
							ct && ct.postMessage(n);
						}
					},
					GetOriginalKey: function (e, t, n) {
						var r = 1;
						if (ze) {
							var o = Module.intArrayFromString(e).concat(0),
								a = Module._malloc(o.length);
							Module.HEAPU8.set(o, a);
							var i = Module.intArrayFromString(t).concat(0),
								s = Module._malloc(i.length);
							Module.HEAPU8.set(i, s);
							var l = Module.intArrayFromString(n).concat(0),
								c = Module._malloc(l.length);
							Module.HEAPU8.set(l, c);
							var f = Module._malloc(256),
								p = Module._malloc(4);
							r = Module._PLAY_GetOriginalKey(u, a, s, c, f, p);
							var d = Module.HEAP32[p >> 2],
								m = '';
							if (1 == r && d <= 256) {
								var g = new ArrayBuffer(d);
								new Uint8Array(g).set(Module.HEAPU8.subarray(f, f + d)),
									(m = (function (e) {
										var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 'utf-8';
										return new TextDecoder(t).decode(e);
									})(g));
							}
							j({ nRet: r, outKey: m }), Module._free(a), Module._free(s), Module._free(c), Module._free(f), Module._free(p);
						} else if (Et) {
							It = !0;
							var S = { nType: 'GetOriginalKeyCallBack', playToken: e, playTokenKey: t, deviceID: n };
							ct && ct.postMessage(S);
						} else (wt = e), (Rt = t), (Mt = n);
						return r;
					},
					SetWebSecurityKey: function (e, t, n, r) {
						if (!ze)
							if (Et) {
								Dt = !0;
								var o = { nType: 'SetWebSecurityKey', nDecryptType: e, nFrameType: t, strKey: n, stStreamInfo: r };
								ct && ct.postMessage(o);
							} else
								(Ot = e),
									1 == t
										? ((Ut[0].nFrameType = t), (Ut[0].strKey = n), (Ut[0].stStreamInfo = r))
										: 21 == t
											? ((Ut[1].nFrameType = 2), (Ut[1].strKey = n), (Ut[1].stStreamInfo = r))
											: 22 == t && ((Ut[2].nFrameType = 2), (Ut[2].strKey = n), (Ut[2].stStreamInfo = r));
					},
					Stop: function () {
						var e = 1;
						if (ze) {
							if (0 == (e = Module._PLAY_Stop(u))) return e;
							(e = Module._PLAY_CloseStream(u)), (he = null), Module._free(Se);
						} else ct && (ct.postMessage({ nType: 'Stop' }), ct.terminate(), (ct = null));
						return (
							Vt(),
							(Ce = null),
							(Ee = null),
							(Ie = null),
							(Re = null),
							(Me = null),
							(De = null),
							(Oe = null),
							(Ue = null),
							(ke = null),
							(Le = null),
							(Ne = null),
							(nt = null),
							(rt = null),
							(ot = null),
							(et = 0),
							Fe && (Fe.stop(), (Fe = null)),
							We && (We.stopRendering(), We.CleanScreen(0, 0, 0, 0), We.terminate(), (We = null)),
							(Te = 0),
							(Ae = 0),
							(xe = 0),
							(P = null),
							(A = null),
							(Qe = !1),
							(b = !1),
							(Ze = 0),
							(Je = 0),
							($e = !1),
							(it = -1),
							(st = !1),
							(je = !1),
							(gt = !1),
							(pt = 0),
							(dt = 0),
							(mt = !1),
							e
						);
					},
					FrameDataCallBack: function (e, t, n, r, o, a) {
						var i = {};
						Ee || ((Ce = new ArrayBuffer(292)), (Ee = new Uint8Array(Ce)), (Ie = new DataView(Ce))),
							Ee.set(Module.HEAPU8.subarray(a, a + 292)),
							(i.nFrameType = Ie.getInt32(0, !0)),
							(i.nFrameID = Ie.getInt32(4, !0)),
							(i.nFrameSubType = Ie.getInt32(56, !0)),
							(i.nYear = Ie.getUint16(40, !0)),
							(i.nMonth = Ie.getUint16(42, !0)),
							(i.nDay = Ie.getUint16(46, !0)),
							(i.nHour = Ie.getUint16(48, !0)),
							(i.nMinute = Ie.getUint16(50, !0)),
							(i.nSecond = Ie.getUint16(52, !0));
						var s = Date.UTC(i.nYear, i.nMonth, i.nDay, i.nHour, i.nMinute, i.nSecond) / 1e3;
						if (1 == i.nFrameType)
							if (((i.nRemainData = Ie.getInt32(36, !0)), (i.bThrowFrame = Ie.getUint8(120, !0)), 0 == i.bThrowFrame)) {
								if (
									((i.nEncodeType = Ie.getInt32(108, !0)),
									(i.nStreamType = Ie.getInt32(112, !0)),
									(i.nTimeStamp = Ie.getUint32(8, !0)),
									pe == i.nStreamType ? (c.timestamp = s) : (c.timestamp = i.nTimeStamp / 1e3),
									(c.timestamp_usec = 0),
									ue == i.nEncodeType || ce == i.nEncodeType || fe == i.nEncodeType ? (Ye = 1) : 12 == i.nEncodeType && (Ye = 2),
									(i.nWidth = Ie.getInt32(12, !0)),
									(i.nHeight = Ie.getInt32(16, !0)),
									0 == i.nWidth || 0 == i.nHeight)
								)
									return;
								if (
									((i.nFrameRate = Ie.getInt32(20, !0)),
									(i.nStride = Ie.getInt32(116, !0)),
									ie == i.nFrameSubType || se == i.nFrameSubType || le == i.nFrameSubType ? (be = 1) : 0 == i.nFrameSubType && (be = 0),
									((1 == Ye && 1 == qe) || (2 == Ye && 1 == Ke)) && !be && de != i.nStreamType)
								)
									(we = new ArrayBuffer(o)), (_e = new Uint8Array(we)).set(Module.HEAPU8.subarray(t, t + o)), xt(_e, null, null, 0, i);
								else {
									if (0 == t || 0 == n || 0 == r) return;
									if (!ze) {
										(i.nWidth == Te && i.nHeight == Ae) ||
											((Re = null),
											(Me = null),
											(De = null),
											(Oe = null),
											(Ue = null),
											(ke = null),
											(Re = new ArrayBuffer(i.nWidth * i.nHeight)),
											(Oe = new Uint8Array(Re)),
											(Me = new ArrayBuffer((i.nWidth * i.nHeight) / 4)),
											(Ue = new Uint8Array(Me)),
											(De = new ArrayBuffer((i.nWidth * i.nHeight) / 4)),
											(ke = new Uint8Array(De)));
										var l = 0;
										for (l = 0; l < i.nHeight; l++) Oe.set(Module.HEAPU8.subarray(t + l * i.nStride, t + l * i.nStride + i.nWidth), l * i.nWidth);
										for (l = 0; l < i.nHeight / 2; l++)
											Ue.set(Module.HEAPU8.subarray(n + (l * i.nStride) / 2, n + (l * i.nStride) / 2 + i.nWidth / 2), (l * i.nWidth) / 2);
										for (l = 0; l < i.nHeight / 2; l++)
											ke.set(Module.HEAPU8.subarray(r + (l * i.nStride) / 2, r + (l * i.nStride) / 2 + i.nWidth / 2), (l * i.nWidth) / 2);
									}
									xt(Oe, Ue, ke, 0, i);
								}
							} else xt(null, null, null, 0, i);
						else if (2 == i.nFrameType) {
							if (((i.nTotalChannel = Ie.getInt32(68, !0)), (i.nCurChannel = Ie.getInt32(72, !0)), i.nCurChannel > 0)) return;
							(i.nBits = Ie.getInt32(28, !0)),
								(i.nSamples = Ie.getInt32(32, !0)),
								(i.nAudioChnNum = Ie.getInt32(24, !0)),
								(Le = new ArrayBuffer(o)),
								(Ne = new Uint8Array(Le)).set(Module.HEAPU8.subarray(t, t + o)),
								(He = new Int16Array(Ne.buffer, Ne.byteOffset, Ne.byteLength / Int16Array.BYTES_PER_ELEMENT)),
								(Be = new Float32Array(He.length));
							for (var u = 0; u < He.length; u++) Be[u] = He[u] / Math.pow(2, 15);
							xt(Be, null, null, 0, i);
						}
						(we = null), (_e = null), (Le = null), (Ne = null), (He = null), (Be = null);
					},
					DecryptionResultCallBack: function (e, t, n) {
						X(n);
					},
					RecordDataCallBack: function (e, t, n, r, o) {
						rt || ((nt = new ArrayBuffer(292)), (rt = new Uint8Array(nt)), (ot = new DataView(nt))), rt.set(Module.HEAPU8.subarray(o, o + 292));
						var a = ot.getInt32(0, !0);
						if ((ot.getInt32(4, !0), ot.getInt32(56, !0), 1 == a)) {
							ot.getInt32(76, !0), ot.getInt32(80, !0), ot.getUint32(8, !0);
							var i = ot.getUint16(40, !0),
								s = qt(ot.getUint16(42, !0)),
								l = qt(ot.getUint16(46, !0)),
								u = qt(ot.getUint16(48, !0)),
								c = qt(ot.getUint16(50, !0)),
								f = qt(ot.getUint16(52, !0)),
								p = Date.UTC(i, s, l, u, c, f) / 1e3,
								d = new Date(''.concat(i, '-').concat(s, '-').concat(l, ' ').concat(u, ':').concat(c, ':').concat(f)).getTime();
							K({ timeStamp: d, utcTimeStamp: p });
						}
						var m = new ArrayBuffer(n),
							g = new Uint8Array(m);
						g.set(Module.HEAPU8.subarray(t, t + n)),
							ze && tt.postMessage({ type: 'addBuffer', buffer: g, offset: r, recordType: at }),
							(m = null),
							(g = null);
					},
					setCallback: function (e, t) {
						switch (e) {
							case 'GetPlayPort':
								te = t;
								break;
							case 'PlayStart':
								G = t;
								break;
							case 'DecodeStart':
								V = t;
								break;
							case 'VideoFrameInfo':
								z = t;
								break;
							case 'AudioFrameInfo':
								q = t;
								break;
							case 'RecordTimeStamp':
								K = t;
								break;
							case 'GetOriginalKey':
								j = t;
								break;
							case 'DecryptionResult':
								X = t;
								break;
							case 'Error':
								Q = t;
								break;
							case 'loadingBar':
								J = t;
								break;
							case 'audioTalk':
								$ = t;
								break;
							case 'StreamPlayOver':
								Z = t;
						}
					},
					GetCurrentPlayTime: function () {
						return c.timestamp;
					},
					SetSTFrameCallback: function (e) {
						ne = e;
					},
				};
				var zt = (function (e) {
					var t = e.document,
						n = function () {
							return e.URL || e.webkitURL || e;
						},
						r = t.createElementNS('http://www.w3.org/1999/xhtml', 'a'),
						o = 'download' in r,
						a = /constructor/i.test(e.HTMLElement),
						i = /CriOS\/[\d]+/.test(navigator.userAgent),
						s = function (t) {
							(e.setImmediate || e.setTimeout)(function () {
								throw t;
							}, 0);
						},
						l = function (e) {
							setTimeout(function () {
								'string' === typeof e ? n().revokeObjectURL(e) : e.remove();
							}, 4e4);
						},
						u = function (e) {
							return /^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(e.type)
								? new Blob([String.fromCharCode(65279), e], { type: e.type })
								: e;
						},
						c = function (t, c, f) {
							f || (t = u(t));
							var p,
								d = this,
								m = 'application/octet-stream' === t.type,
								g = function () {
									!(function (e, t, n) {
										for (var r = (t = [].concat(t)).length; r--; ) {
											var o = e['on' + t[r]];
											if ('function' === typeof o)
												try {
													o.call(e, n || e);
												} catch (e) {
													s(e);
												}
										}
									})(d, 'writestart progress write writeend'.split(' '));
								};
							if (((d.readyState = d.INIT), o))
								return (
									(p = n().createObjectURL(t)),
									void setTimeout(function () {
										(r.href = p), (r.download = c), r.dispatchEvent(new MouseEvent('click')), g(), l(p), (d.readyState = d.DONE);
									})
								);
							!(function () {
								if ((i || (m && a)) && e.FileReader) {
									var r = new FileReader();
									return (
										(r.onloadend = function () {
											var t = i ? r.result : r.result.replace(/^data:[^;]*;/, 'data:attachment/file;');
											e.open(t, '_blank') || (e.location.href = t), (t = void 0), (d.readyState = d.DONE), g();
										}),
										r.readAsDataURL(t),
										void (d.readyState = d.INIT)
									);
								}
								p || (p = n().createObjectURL(t)),
									m ? (e.location.href = p) : e.open(p, '_blank') || (e.location.href = p),
									(d.readyState = d.DONE),
									g(),
									l(p);
							})();
						},
						f = c.prototype;
					return 'undefined' !== typeof navigator && navigator.msSaveOrOpenBlob
						? function (e, t, n) {
								return (t = t || e.name || 'download'), n || (e = u(e)), navigator.msSaveOrOpenBlob(e, t);
							}
						: ((f.readyState = f.INIT = 0),
							(f.WRITING = 1),
							(f.DONE = 2),
							(f.error = f.onwritestart = f.onprogress = f.onwrite = f.onabort = f.onerror = f.onwriteend = null),
							function (e, t, n) {
								return new c(e, t || e.name || 'download', n);
							});
				})(window);
				function qt(e) {
					return e < 10 ? '0'.concat(e) : e;
				}
				return new kt();
			};
		t.default = function (e) {
			var t = null,
				n = null,
				r = !1,
				o = !1,
				a = null,
				i = null,
				s = !0,
				l = !1,
				u = 0,
				c = !1,
				f = 1,
				p = e,
				d = 0,
				m = !1,
				g = '',
				S = 0,
				h = '',
				_ = '',
				v = {
					Disconnect: function () {},
					GetPlayPort: function () {},
					PlayStart: function () {},
					DecodeStart: function () {},
					VideoFrameInfo: function () {},
					AudioFrameInfo: function () {},
					RecordTimeStamp: function () {},
					GetOriginalKey: function () {},
					DecryptionResult: function () {},
					PlayBackStreamRange: function () {},
					StreamPlayOver: function () {},
					StreamRedirect: function () {},
					Error: function () {},
				};
			function y() {}
			function T() {
				if ((p ? i && (a.StopStream(), (a = null), (i = null)) : (b('TEARDOWN'), t && t.disconnect(), (t = null)), o))
					return (o = !1), n && n.StopRecord();
			}
			function A(e) {
				e != l && ((l = e), p ? i && a.PauseStream(e) : b(e ? 'PAUSE' : 'PLAY'));
			}
			function b(e, n, r) {
				var o;
				(o = 'video' === n ? { command: e, range: r || 0 } : { command: e, data: n }), t && t.controlPlayer(o);
			}
			function P() {
				setTimeout(function () {
					n && (u = n.GetSourceBufferRemain());
				}, 1),
					r && (u > 7340032 ? A(!0) : u < 2097152 && A(!1));
			}
			function E(e) {
				m ||
					((m = !0),
					(function () {
						if (!p) {
							var e = t && t.GetSSRC(),
								r = t && t.GetSdpInfo(),
								o = {};
							if (((o.sdpInfo = r), (o.strUserName = h), (o.strPassWord = _), 0 == S)) return;
							(1 == S && 0 == e.videoSSRC) || ((o.nSsrc = e.videoSSRC), n.SetWebSecurityKey(S, 1, g, o)),
								1 == S &&
									(0 != e.audio1SSRC && ((o.nSsrc = e.audio1SSRC), n.SetWebSecurityKey(S, 21, g, o)),
									0 != e.audio2SSRC && ((o.nSsrc = e.audio2SSRC), n.SetWebSecurityKey(S, 22, g, o)));
						}
					})()),
					(!r && u > 7340032) || (n && n.InputData(e));
			}
			function I() {
				P();
			}
			function R() {
				n && n.SetStreamOver(!0);
			}
			function M(e) {
				if (p) {
					if (i) {
						var n = e.slice(6);
						a.PutStream(n);
					}
				} else t && t.sendRtpData(e);
			}
			return (
				(y.prototype = {
					Init: function (e) {
						return (function (e) {
							(r = e.bPlayBack), null == n && (n = new ge(p));
							var t = n.Init(e);
							if (t > 0) {
								var o = n.GetPlayPort();
								p && v.GetPlayPort(o);
							}
							for (var a in v) n.setCallback(a, v[a]);
							return n.SetSTFrameCallback(I), t;
						})(e);
					},
					StartPullStream: function (e) {
						return (function (e) {
							if ((n.SetAudioTalkFlag(e.bTalkService), p)) null == a && (a = new w());
							else {
								(h = e.strUserName), (_ = e.strPassWord), (g = e.strDeviceID);
								var o = e.strRtspvUrl.indexOf('&encrypt=');
								for (var l in (-1 != o && (S = e.strRtspvUrl.slice(o + 9, o + 10)), null == t && (t = new C()), v)) t && t.setCallback(l, v[l]);
							}
							var u = e.strRtspvUri;
							-1 != e.strRtspvUrl.indexOf('rtsp://')
								? ((s = !0), -1 != e.strRtspvUri.indexOf('?') ? (e.strRtspvUri += '&rtspoverwebsocket') : (e.strRtspvUri += '/rtspoverwebsocket'))
								: ((s = !1),
									-1 != e.strRtspvUri.indexOf('?') ? (e.strRtspvUri += '&httpprivateoverwebsocket') : (e.strRtspvUri += '/httpprivateoverwebsocket'));
							var c = e.nShortTimeout || 3,
								f = e.nRtspResponseTimeout || 8;
							if (p) {
								if (!s && -1 == e.strRtspvUrl.indexOf('http://')) {
									var o = u.indexOf('://');
									(u = u.slice(o)), (e.strRtspvUrl = 'http' + u + e.strRtspvUrl);
								}
								e.strSourceId.length > 0 && ((e.strRtspvUrl += '?sourceId='), (e.strRtspvUrl += e.strSourceId)),
									(i = a.StartStream(e, s)),
									a.SetMsgWaitTimeout(c),
									(function (e) {
										d = setTimeout(function () {
											d && (clearTimeout(d), (d = 0)), v.Error({ errorCode: '409', description: 'Rtsp Not Response' });
										}, 1e3 * e);
									})(f);
							} else {
								var m = { bTalkService: e.bTalkService, nRange: e.nRange, bPlayBack: r, bRtspFlag: s, nShortTimeout: c, nRtspResponseTimeout: f };
								t.connect(e.strRtspvUri, e.strRtspvUrl, e.strSourceId, m),
									t.setUserInfo(e.strUserName, e.strPassWord),
									t.setRtpDataCallback(E),
									t.setStreamFinishCallback(R);
							}
							return n && n.SetStreamOver(!1), i;
						})(e);
					},
					StopPullStream: function () {
						T();
					},
					Pause: function (e) {
						!(function (e) {
							A(e), n.Pause(e);
						})(e);
					},
					Stop: function () {
						n.Stop(), (n = null), (m = !1);
					},
					SetSecurityKey: function (e, t, r, o, a) {
						!(function (e, t, r, o, a) {
							n.SetSecurityKey(e, t, r, o, a);
						})(e, t, r, o, a);
					},
					SetSpeed: function (e) {
						(f = e),
							(function (e) {
								p ? i && a.PlayControl(-1, -1, e) : b('SCALE', e), n.SetPlaySpeed(e);
							})(e);
					},
					SetSoundState: function (e) {
						!(function (e) {
							n.SetSoundState(e);
						})(e);
					},
					SetVolume: function (e) {
						!(function (e) {
							n.SetVolume(e);
						})(e);
					},
					StartRecord: function (e, t, r) {
						return (function (e, t, r) {
							return (o = !0), n.StartRecord(e, t, r);
						})(e, t, r);
					},
					StopRecord: function () {
						return (o = !1), n.StopRecord();
					},
					OpenIVS: function (e) {
						return (function (e) {
							return n.OpenIVSDraw(e);
						})(e);
					},
					CloseIVS: function () {
						return n.CloseIVSDraw();
					},
					SetIvsEnable: function (e, t) {
						return (function (e, t) {
							return n.SetIvsEnable(e, t);
						})(e, t);
					},
					SetPanoAR: function (e) {
						return (function (e) {
							return n.SetPanoAR(e);
						})(e);
					},
					Set3DPoint: function (e) {
						return (function (e) {
							return n.Set3DPoint(e);
						})(e);
					},
					OnMouseDown: function () {
						return n.OnMouseDown();
					},
					OnMouseMove: function (e, t) {
						return (function (e, t) {
							return n.OnMouseMove(e, t);
						})(e, t);
					},
					OnMouseUp: function () {
						return n.OnMouseUp();
					},
					OnMouseWheel: function (e) {
						return (function (e) {
							return n.OnMouseWheel(e);
						})(e);
					},
					CapturePic: function (e) {
						!(function (e) {
							n.capturePic(e);
						})(e);
					},
					StartTalk: function (e, t) {
						!(function (e, t) {
							n.setCallback('audioTalk', M), n.StartTalk(e, t);
						})(e, t);
					},
					StopTalk: function () {
						n.StopTalk();
					},
					SetSeekTime: function (e) {
						!(function (e) {
							p ? i && a.PlayControl(e, -1, f) : b('PLAY_SEEK', e), n.ResetBuffer();
						})(e);
					},
					OpenPlayGroup: function () {
						return n.OpenPlayGroup();
					},
					AddToPlayGroup: function (e, t) {
						return (function (e, t) {
							return n.AddToPlayGroup(e, t);
						})(e, t);
					},
					DelFromPlayGroup: function (e, t) {
						return (function (e, t) {
							return n.DelFromPlayGroup(e, t);
						})(e, t);
					},
					ClosePlayGroup: function (e) {
						return (function (e) {
							return n.ClosePlayGroup(e);
						})(e);
					},
					PausePlayGroup: function (e, t) {
						return (function (e, t) {
							return A(t), n.PausePlayGroup(e, t);
						})(e, t);
					},
					SetPlayGroupSpeed: function (e, t) {
						return (
							(f = t),
							(function (e, t) {
								return p ? i && a.PlayControl(-1, -1, t) : b('SCALE', t), n.SetPlayGroupSpeed(e, t);
							})(e, t)
						);
					},
					GetSourceBufferRemain: function () {
						return (u = n.GetSourceBufferRemain());
					},
					SetDecodeMode: function (e, t) {
						!(function (e, t) {
							n.SetDecodeMode(e, t);
						})(e, t);
					},
					GetOriginalKey: function (e) {
						!(function (e) {
							n.GetOriginalKey(e.strPlayToken, e.strPlayTokenKey, e.strDeviceID);
						})(e);
					},
					SetCallBack: function (e, t) {
						v[e] = t;
					},
					InputData: function (e, t) {
						if ((d && (clearTimeout(d), (d = 0)), r && !c)) {
							c = !0;
							var o = a.GetPlayInfo();
							v.PlayBackStreamRange(o);
						}
						var i = new ArrayBuffer(t),
							s = new Uint8Array(i);
						return s.set(SCModule.HEAPU8.subarray(e, e + t)), n && n.InputData(s);
					},
					SetFrameData: function (e, t, r, o, a, i) {
						P(), n.FrameDataCallBack(e, t, r, o, a, i);
					},
					SetDecryptionResult: function (e, t, r) {
						n.DecryptionResultCallBack(e, t, r);
					},
					SetRecordData: function (e, t, r, o, a) {
						n.RecordDataCallBack(e, t, r, o, a);
					},
					StreamRedirectCallback: function (e) {
						!(function (e) {
							T();
							var t = new ArrayBuffer(1e3),
								n = new Uint8Array(t);
							n.set(SCModule.HEAPU8.subarray(e, e + 1e3));
							var r = (function (e) {
								for (var t = '', n = 0; n < e.length; n++) {
									var r = String.fromCharCode(e[n]);
									if (((t += r), '\0' == r)) break;
								}
								return t;
							})(n);
							v.StreamRedirect(r);
						})(e);
					},
					StreamDisconnectCallback: function () {
						v.Disconnect();
					},
					StreamFinishCallback: function () {
						R();
					},
					StreamFailedCallback: function (e) {
						(285868036 != e && 6500424 != e) ||
							(d && (clearTimeout(d), (d = 0)), v.Error({ errorCode: '408', description: 'Short Request Timeout' }));
					},
				}),
				new y()
			);
		};
	},
]).default;
